0

For custom date picker I am using the

https://github.com/squimer/DatePickerDialog-iOS-Swift

its working fine but I need to add two things on this

1.I need to re arrange the components order like date/month/year(i.e 23/05/2016) instead of the month/date/year(i.e 05/23/2016).

2.I need another datepicker object with only two components i.e month/year (may/2016).

How can I achieve this

Thank you in advance

WeCan
  • 547
  • 2
  • 9
  • 23

1 Answers1

0

You cannot do this with UIDatePicker, and since that project uses UIDatePicker, you can't do it with that project.

UIDatePicker has extremely limited customization options. You can have it show a date, or a time, or both. But you can't tell it how to display the date, so you can't rearrange the components or choose which date components to show.

If you need these formats, you will need use UIPickerView and implement your own delegate and dataSource methods to display the options that you need. Or maybe you can find a different open source project that does what you need.

Tom Harrington
  • 69,312
  • 10
  • 146
  • 170
  • sorry for lately reply to you. Now I will work on UIDatePickerView and then I will update my status. thank you – WeCan May 24 '16 at 05:37
  • after a hours of searching google I am getting one free controller for only MONTH/YEAR format https://github.com/jeksys/UIMonthYearPicker but its not working , it is crashed if I run the above project. Thank you – WeCan May 24 '16 at 09:54
  • Solved my problem, I recheck the delegate and datasource connections my of UIPickerView in storyboard then finally I got a picker view with MAY/2016 MONTH/YEAR format. – WeCan May 24 '16 at 10:29