squimer / DatePickerDialog-iOS-Swift

Date picker dialog for iOS
MIT License
584 stars 178 forks source link

Not working correctly with ios 14 #112

Open mikeld opened 4 years ago

mikeld commented 4 years ago

Can't select a date Can you help me please.

Captura de pantalla 2020-09-24 a las 8 35 52
mikeld commented 4 years ago

This is the code using DatePickerDialog. It works perfectly in ios < 14 DatePickerDialog().show("Event Date", doneButtonTitle: "Accept", cancelButtonTitle: "Cancel", datePickerMode: .date) { (date) -> Void in if (date != nil) { self.dateEvent = date self.lblDateEvent.text = "(dateFormatter.string(from:date!))" //update map self.showMapPoints() } }

lexin commented 4 years ago

The preferredDatePickerStyle should be set Something like this if #available(iOS 13.4, *) { datePicker.preferredDatePickerStyle = .wheels }

mikeld commented 4 years ago

Thank you very much lexin! now works. You are the best.

bhaveshsingh0206 commented 4 years ago

what is dataPicker in this case?

bhaveshsingh0206 commented 4 years ago

@lexin what is dataPicker in ur case?

mehyaz commented 4 years ago

@lexin what is dataPicker in ur case?

I put it in DatePickerDialog.swift

Ekran Resmi 2020-09-26 18 59 44
UtkuDalmaz commented 4 years ago

Same here

acsarraf commented 4 years ago

@lexin I tried adding your fix but I still get a similar image as OP. Anyone else also facing this?

jis247 commented 3 years ago

Go to DatePickerDialog.swift in Sources Folder and add this line if #available(iOS 13.4, *) { datePicker.preferredDatePickerStyle = .wheels } @mehyaz showed in the above image worked for me

ReadyChen22 commented 3 years ago

worked for me

wil-low commented 3 years ago

This line is already in the source, should this issue be closed?

Abiolagbode commented 3 years ago

@lexin what is dataPicker in ur case?

I put it in DatePickerDialog.swift

Ekran Resmi 2020-09-26 18 59 44

worked for me thanks.

raaja-nithra commented 3 years ago

Screenshot 2021-02-25 at 12 50 21 PM

Shows Error @lexin Please Help..

iliasahmed commented 3 years ago

Screenshot 2021-02-25 at 12 50 21 PM

Shows Error @lexin Please Help..

replace the line by if #available(iOS 13.4, *) { self.datePicker.datePicker.preferredDatePickerStyle = .wheels }