Hello,
I am following the Swift course and am stuck with the Grids chapter on the Cookademy project.
I had errors in prior chapters I could research myself, as Xcode and Swift changed since the course material was introduced, but with this example I am stuck.
In the extension of the RecipesListView I am getting the error message
Cannot call value of non-function type ‘[Recipe]’
for this code piece
private var recipes: [Recipe] {
recipeData.recipes(for: category)
}
The whole extension goes as follows
extension RecipesListView {
func recipes(for category: MainInformation.Category) -> [Recipe] {
var filteredRecipes = [Recipe]()
for recipe in recipeData.recipes {
if recipe.mainInformation.category == category {
filteredRecipes.append(recipe)
}
}
}
private var recipes: [Recipe] {
recipeData.recipes(for: category)
}
private var navigationTitle: String {
"\(category.rawValue) Recipes"
}
}
Any help would be appreciated.
Kind regards