you need to select a date selection mode
@IBOutlet weak var myDatePicker: UIDatePicker! override func viewDidLoad() { super.viewDidLoad() myDatePicker.datePickerMode = .date
date selection options .
SWIFT Declaration
var datePickerMode: UIDatePickerMode
Discussion The value of this property indicates the date selection mode. This determines whether the date picker allows you to select a date, time, both a date and time, or a countdown time. The default mode is UIDatePickerModeDateAndTime. See Date Selection Mode for a list of constant modes.
UIDatePickerMode
Date selection mode.
declaration constants
Time
Date selection displays hours, minutes, and (optionally) AM / PM. The exact items shown and their order depend on the set of locales. An example of this mode is [6 | 53 | PM].
Available in iOS 2.0 and later.
the date
Date selection shows months, days of the month, and years. The exact order of these elements depends on the locale setting. An example of this mode is [November | 15 | 2007].
Available in iOS 2.0 and later.
DateAndTime
Date selection displays dates (as a single day of the week, month, and day of the month) plus hours, minutes, and (optionally) AM / PM. The exact order and format of these elements depends on the set of locales. An example of this mode is [Wed Nov 15 | 6 | 53 | PM].
Available in iOS 2.0 and later.
CountDownTimer
Selecting a date displays the hours and minutes, for example [1 | 53]. The application should set a timer for firing at the appropriate interval and set the date selection when mark seconds.
Available in iOS 2.0 and later.