From the course: SwiftUI Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Pickers

Pickers

- [Instructor] One type of control is the multi selection picker. Let's look at pickers and how to use them in several styles by selecting different crusts for our pizzas. If you look over on our model code here and you go into menu item, you'll find that we actually have an enumeration called pizza crust and it's set up for strings. So we got all these strings set up for this. And it's also something called CaseIterable that I talked about earlier, which means I can loop through this and show all the cases. So with that in mind, I'm going to be able to use this in my picker and it's a common way of doing it, either using a loop or an array of some kind or possibly something like this in your pickers. So what we're going to do is go back up to our order item view, which is up here. I'm going to start this by moving everything up. So let's put a spacer in here so we have a nice amount of space so we can see things better.…

Contents