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

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…

Contents