UIDatePicker is not working on macOS Catalina

44 views Asked by At

Here is the code for UIDatePicker:

_datePicker = [[UIDatePicker alloc] init];
_datePicker.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
_datePicker.datePickerMode = UIDatePickerModeDate;
_datePicker.preferredDatePickerStyle = UIDatePickerStyleWheels;
_datePicker.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
_datePicker.backgroundColor = [UIColor whiteColor];

It is working on macOS Ventura, but not working on macOS Catalina. It shows nothing:

image error

I have tried the other options of preferredDatePickerStyle, but it's still not working.

0

There are 0 answers