Skip to content

UIDatePicker() constructor ​

The UIDatePicker() constructor creates a date picker.

Syntax ​

new UIDatePicker()

Parameters ​

None.

Return value ​

A new UIDatePicker:

Examples ​

js
const picker = new UIDatePicker();
console.log(picker.datePickerMode, picker.datePickerStyle);

Result: Prints dateAndTime compact.

Corresponding iOS API ​

[[UIDatePicker alloc] init].

See also ​