From the course: iOS 14 Development Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using a slider in SwiftUI

Using a slider in SwiftUI

From the course: iOS 14 Development Essential Training

Start my 1-month free trial

Using a slider in SwiftUI

- [Instructor] Next, we're going to look at another user interface element that uses binding and that's a slider. And the reason why we're looking at that, is so that we can build a color picker application that has red, green, and blue sliders, that will update the color of our controller icon. The first thing to do in this, is to change our controller image to support a custom color. Remember, we could modify that using our visual interface, so with our image selected, I'm going to open up the utility area, and then change foreground color to custom, and watch the code update here, and then I'm going to hide the utility area. It actually would have taken a bit to write this out or to modify this even using code hinting. So sometimes changing something with the utility area, might save you a little bit of time. So now we have our color object and I'm going to create some values. So var, red equals 0.0, and then…

Contents