Insert empty value into date picker in iphone

I have a date picker that is shown using an action sheet. I want to insert an empty value into a date picker and set it as the default value. It should change only when the user selects. Is it possible? If so, how? All valuable suggestions are welcome.

+4
source share
1 answer

UIDatePicker supports only certain modes and does not allow such a setting (adding empty or user data to spinners). Oh, the documentation indicates that it does not inherit from UIPickerView , so you cannot easily get at the custom selection object that it works with.

Why not create your own pair of views and controllers that implements UIPickerViewDelegate and create your own - you can find slightly more detailed and useful tips in this related question .

Or consider a different and less painful way to accomplish what you are trying to do.

+3
source

Source: https://habr.com/ru/post/1386262/


All Articles