UIMonthYearPicker is a UIPickerView subclass that allows you select date from month and year only, no days.
-
Place a UIPickerView object in the storyboard or XIB editor. Rename class to UIMonthYearPicker. or Create an instance of the UIMonthYearPicker manually.
-
Implement UIMonthYearPickerDelegate protocol
- (void)viewDidLoad
{
[super viewDidLoad];
datePicker._delegate = self;
}
- (void) pickerView:(UIPickerView *)pickerView didChangeDate:(NSDate *)newDate {
}
base on the souce code by Igor Fedorchuk http://stackoverflow.com/questions/3348247/uidatepicker-select-month-and-year