From the course: Complete Guide to SwiftUI
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Moving data in pickers
From the course: Complete Guide to SwiftUI
Moving data in pickers
- [Instructor] We've got a problem with our picker. All pizzas have a default recommended crust. I want to set up the picker to start on that default, but that's not as easy as it looks. Go ahead over to OrderItem first, and let's take a look at somethin' here, okay? We've got here an OrderItem, and you can see that we've got a preferredCrust here, but we also have here a MenuItem. And if you look inside of MenuItem, it also has a crust, okay? So I'm going to have to figure out how to use this. And so this is the default crust in the MenuItem. And then, in OrderItem, this is the crust that the customer requests. So I'm going to start playing with that and try to figure out a way to get this to work, that I can get that MenuItem one into OrderItem preferredCrust when I get to this particular page that we're dealing with in OrderItemView. So, how are we going to do this? There are two ways to handle it, both with their…
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)
-
-
-
-
-
-
-
-
-
-