As revealed at WWDC 2020, Apple has given the Date and Time Picker an Airbnb-style upgrade. Since there isn’t a new name for this Date Picker, let’s just call it the Modern Date Picker.

“Display a calendar date and provide controls for editing the date value.” — Apple’s documentation


Prerequisites

To follow along with this tutorial, you’ll need some basic knowledge in:

  • Swift
  • At least Xcode 12+

Note: This only supports iOS 14+.


Modern Date Picker

To give you a better picture of the transformation, take one last look at the traditional Date Picker. Now look at the Modern Date Picker with one line of code:

datePicker.preferredDatePickerStyle = .compact

#programming #swift #mobile #wwdc-2020 #ios

Introducing Swift’s New Modern Date Picker
6.20 GEEK