To set the maximum date of date picker in ios to today.
for example , if we want to pick the date of birth of a user then the date is can not be greater then today date .
So we can use following step to set the maximum date of datePicker
step 1:- Drag a UIDatePicker Controller to viewController
Step2 :- Crate an IBOutlet to UIDatePicker
Step 3:- in ViewDidLoad Write the simple line of code
_datePicker.maximumDate = [NSDate date]; // _datePicker is a outlet.
0 Comment(s)