ios_catalogue1-4 Exercise 2: Item Count in the Title ===================================================== Simplest: compute it in the view, where shownItems already exists: .navigationTitle("My Catalogue (\(shownItems.count))") Where should it live? Both work, but the view is better here: - shownItems.count is already exactly "the number currently listed". - A model property such as func count(of items: [Item]) -> Int { filtered(items).count } would just repeat filtered(_:) and add nothing, because the model does not own the items (the @Query does). A reason to put it in the view model instead: a calculation that is more than one expression or that you want to unit-test without a view. For this one-liner, testing the filtering (filtered(_:)) already covers it. Note that the title updates by itself when items are added or the filter changes, because both shownItems and the model's selectedTypeName are tracked.