Post

Replies

Boosts

Views

Activity

UIDatePicker crashes on setting maximumDate in iOS 16.0
Hi My app is continuously crashing while setting maximumDate in date picker, this happens only with new iOS 16.0. I am trying to set minimum and maximum date limit on date picker for accepting birth date, i.e. minimum age 18 years. Crashing on this line: datePicker.maximumDate = maxDate Detailed code: var components: DateComponents = DateComponents() components.calendar = calendar components.year = -18 let maxDate: Date = calendar.date(byAdding: components, to: currentDate)! datePicker.maximumDate = maxDate Please note, this code works fine in lower version than iOS 16.0. Xcode: Version 14.0 macOS Monterey Version 12.6 iOS 16.0
1
0
863
Sep ’22