Another common object which can be quite useful is the Date Picker. Add it to a view from the library, set up an outlet in the controller code file to receive the currently displayed value, and customize as to whether both date and time are required or one or the other (or, alternatively, a countdown timer), language and locale (which decides the display format), and so on. It is initialized by default to the current date, but this can be overridden, and minimum and maximum date ranges can be imposed. Incidentally, for 24-hour clock, choose, e.g., English (Europe).
Tapping the date picker opens up a calendar and/or time selection tool; clicking outside this dismisses it and updates the date displayed.
This value can be accessed programmatically as follows:
// Sample outlet declaration: @IBOutlet weak var dateDisplayed: UIDatePicker! ⋮ // Store the value in a variable. Note that the value is // stored as universal time; this is interpreted in display // fields according to current locale as required. let storedDate = dateDisplayed.date