alerts-and-pickers
alerts-and-pickers copied to clipboard
How to get date from picker, if opened and closed picker on done event without any changes?
Picker does not return any value on done button while we don't select anything and just press done button. If i want to get default selected value on done press event then what should i do?
you should set the current date in var like var currentDate = Date() then set that variable to your default label or text. Then when you pick any date from picker then update value of currentDate to picked date like currentDate = pickableDate