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

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