Set Years to maximum in UIDatePicker

2019-08-29 11:28发布

问题:

I am using a custom uidatepicker for my app from

https://github.com/christopherney/FlatDatePicker

The Problem is, The minimum year is 1900 (Which is Fine) but the Maximum year is 2013 (Which is not fine). How could I change this so the Maximum year is infinite or even like the year 2200 or something?

Thanks in Advance!

回答1:

Simply set the maximumDate property of your date picker:

datePicker.maximumDate = [NSDate distantFuture];


回答2:

Try:

[datePicker setMaximumDate:yourmaxDate];