From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Color pickers

Color pickers

- [Instructor] There's a lot of changes in SwiftUI. Too small but important ones are color pickers and disclosure groups. Let's take a look. Now I've got a SwiftUI app started here and I set the simulator to a iPhone 11 Pro Max, I scaled this out so you can see it. And it's pretty much just a picture of a pizza and the title. Well, what I'm going to try to do is get it so that we can get a frame around this and a background so I can make my picture of my pizza look nice. So we're going to start this by adding this new color picker idea here. So you can see down here in the code, I'm going to type in color picker, and that is going to be a binding variable. I'm going to call it color, you can see I have up on top, a state variable called color, which I'm going to use for my background color. And the second argument I'm going to use this supports opacity. And I'm going to make that true and I'll explain that one in a…

Contents