- Download and drop
/AIDatePickerController
folder in your project. - Congratulations!
// Create a date
NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
NSDate *date = [dateFormatter dateFromString:@"1955-02-24"];
// Create an instance of the picker
AIDatePickerController *datePickerViewController = [AIDatePickerController pickerWithDate:date selectedBlock:^(NSDate *selectedDate) {
// Do what you want with the picked date.
} cancelBlock:^{
// Do what you want when the user pressed the cancel button.
}];
// Present it
[self presentViewController:datePickerViewController animated:YES completion:nil];
- iOS >= 7.0
- ARC
Inspired by Roland Moers's RMDateSelectionViewController.
Ali Karagoz
AIDatePickerController is available under the MIT license. See the LICENSE file for more info.