From the course: Complete Guide to SwiftUI
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Solution: Favorites grid
From the course: Complete Guide to SwiftUI
Solution: Favorites grid
- [Instructor] Okay, so let's start this. And I'm going to, first of all, move favorites from here as a view into the model. So I'm just going to click on that. Drag it into model code, and there it is. And so I can now close up model code. I'm not going to need it for a while. And the second thing I'm going to do is go ahead and click on FavoriteCellView because the next thing I want to do is make a new view. So I'm going to do a command N, and that makes sure that I put it in the right place. And there's a SwiftUI view. And I'll hit next. And I'm going to call this FavoritesGridView. Okay, and it's going to HuliPizza and HuliPizza, correct, so we can now create. And I'm going to close everything up at the code for now, so let's close that up. Close that up. All right, so we're going to start with a binding variable, and we'll make a favorites. And this will be an array of menu items. And I'll do another binding variable. And again, over here. And we're going to call this one…
Contents
-
-
-
-
-
-
-
-
(Locked)
Toggles and steppers6m 8s
-
(Locked)
Pickers6m 10s
-
(Locked)
Moving data in pickers5m 54s
-
Text input7m 1s
-
(Locked)
Lazy grids6m 37s
-
(Locked)
Tap gestures3m 1s
-
(Locked)
Reacting to changes5m 59s
-
(Locked)
Challenge: Favorites grid1m 46s
-
(Locked)
Solution: Favorites grid8m 55s
-
(Locked)
Challenge: Add a grid view to the app40s
-
(Locked)
Solution: Add a grid view to the app6m 10s
-
(Locked)
-
-
-
-
-
-
-
-
-
-