DatePickerDialog-iOS-Swift icon indicating copy to clipboard operation
DatePickerDialog-iOS-Swift copied to clipboard

Not working correctly with ios 14

Open mikeld opened this issue 5 years ago • 14 comments

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

Captura de pantalla 2020-09-24 a las 8 35 52

mikeld avatar Sep 24 '20 06:09 mikeld

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() } }

mikeld avatar Sep 24 '20 06:09 mikeld

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

lexin avatar Sep 24 '20 10:09 lexin

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

mikeld avatar Sep 24 '20 11:09 mikeld

what is dataPicker in this case?

bhaveshsingh0206 avatar Sep 25 '20 17:09 bhaveshsingh0206

@lexin what is dataPicker in ur case?

bhaveshsingh0206 avatar Sep 25 '20 17:09 bhaveshsingh0206

@lexin what is dataPicker in ur case?

I put it in DatePickerDialog.swift Ekran Resmi 2020-09-26 18 59 44

mehyaz avatar Sep 26 '20 16:09 mehyaz

Same here

UtkuDalmaz avatar Oct 01 '20 13:10 UtkuDalmaz

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

acsarraf avatar Oct 06 '20 18:10 acsarraf

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

jis247 avatar Oct 14 '20 12:10 jis247

worked for me

ReadyChen22 avatar Nov 22 '20 18:11 ReadyChen22

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

wil-low avatar Jan 16 '21 05:01 wil-low

@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.

Abiolagbode avatar Feb 10 '21 10:02 Abiolagbode

Screenshot 2021-02-25 at 12 50 21 PM

Shows Error @lexin Please Help..

raaja-nithra avatar Feb 25 '21 07:02 raaja-nithra

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 }

iliasahmed avatar Mar 02 '21 17:03 iliasahmed