IOS13.4 UIDatePicker added the preferredDatePickerStyle attribute

@available(iOS 13.4, *) public enum UIDatePickerStyle: Int {/// This attribute automatically selects the best style for the current platform and mode. Case wheels = 1 // Use compact styles for date pickers. Editing takes place in the overlay. Case Compact = 2 // Use a style for the date picker that allows editing in place. @available(iOS 14.0, *) case inline = 3 }Copy the code

So if the requirements are the same as before, change the properties

# if available (iOS 13.4. *) {datePicker. PreferredDatePickerStyle =. Wheels}Copy the code