From the course: iOS Development Tips

Unlock this course with a free trial

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

Date pickers

Date pickers

- [Instructor] One change in iOS 14 to SwiftUI is date pickers. Let's take a quick look at that change. Now I have an exercise file here for a state variable for a date. So we got our state variable. And it just shows a date. Real simple. So let's go ahead and run that and see what it looks like on the live preview, and I'm going to go ahead and close this up, 'cause we're not going to need it. And I'm going to go ahead and open up with a Command option + Return, I'll open up the preview and let that resume. And that builds it, and let's go to live preview. And that looks pretty simple. I mean, it's just says, "Hello, Date Picker", and gives me my date, no big deal. Now, what we can do with this is I can put right underneath that text for the date, I can put a date picker. And so I'm going to put in one version of this for a date picker, which uses a string for a label. I'll make that a capital D. And…

Contents