Swift Data
The Model
swift
@Model
class Recipe {
@Attribute(.unique) var name: String
var summary: String?
var ingredients: [Ingredient]
}
The UI
swift
@Query var recipes: [Recipe]
var body: some View {
List(recipes) { recipe in
NavigationLink(recipe.name, destination: RecipeView(recipe))
}
}
Resources
Video Tutorials
- https://www.youtube.com/watch?v=krRkm8w22A8&t=528s
- https://www.youtube.com/watch?v=FEKCAzPAtpg&list=PLuoeXyslFTuZ9Nag8qTVz5wQ7zRprxMxN&index=1
- https://www.youtube.com/watch?v=kLNNNXD8X2U&list=PLvUWi5tdh92wZ5_iDMcBpenwTgFNan9T7
- https://www.youtube.com/watch?v=CAr_1kcf2_c
- https://www.youtube.com/watch?v=uvLUJev1F20