Home > Enterprise >  Swift Date Picker hide days of the week
Swift Date Picker hide days of the week

Time:03-09

I use standard Apple UIDatePicker with inline style. How can I hide the days of the week? I did not find the method on the Internet

screenshot

CodePudding user response:

Have you tried to change the Mode from Attributes Inspector ? By default the mode is set to Date and Time. You need to change it from there or you can create your own CustomDatePicker to display only the months or only the years. Take a look to this CustomDatePicker example here: https://github.com/Anandsan/UICustomDatePicker

Or you can use a UIPickerView to set all the months and another UIPickerView to set the years you want to display and after that you can extract the selected values and to use them in your app.

  • Related