From the course: SwiftUI Essential Training
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Moving data in pickers
From the course: SwiftUI Essential Training
Moving data in pickers
- [Instructor] We've got a problem with our picker. All pizzas have a default recommended crossed. I want to set up the picker to start on that default but that's not as easy as it looks. Go ahead and over to OrderItem first and let's take a look at something 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 OrderItem view. So how are we going to do this? There are two ways to handle it, both with their…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
Toggles and steppers6m 8s
-
(Locked)
Pickers6m 10s
-
(Locked)
Moving data in pickers5m 54s
-
(Locked)
Text input7m 1s
-
(Locked)
Lazy grids6m 37s
-
(Locked)
Tap gestures3m 1s
-
(Locked)
Challenge: Favorites grid53s
-
(Locked)
Solution: Favorites grid8m 29s
-
(Locked)
Animation5m 35s
-
(Locked)
Matched geometry3m 44s
-
(Locked)
Challenge: Replace MenuView54s
-
(Locked)
Solution: Replace MenuVIew8m 8s
-
-
-
-