Strange behavior in iOS 6.1 I have set the minimum date to current date for my date picker like this
NSDate *currentTime = [NSDate date];
[picker setMinimumDate:currentTime];
But when I run the app I am able to scroll to past date, though its not selected, picker doesn't jump back to current date. It's happening only with iOS 6.1 version and in rest picker is behaving normally.
I got the same issue as you and fixed it with only setting the date to the maximum date manually (in this case I set the limit to the current date):
- (IBAction)pickerValueChanged:(id)sender {
dispatch_async(dispatch_get_main_queue(), ^{
UIDatePicker *datePicker = (UIDatePicker *)sender;
if ([self.datePicker.date compare:[NSDate date]] == NSOrderedDescending) {
datePicker.date = [NSDate date];
}
});
}
This function is triggered when the date value from the date picker did change. you can set a maximum or minimum value here.