diff --git a/UI7KitCatalog/Catalog.storyboard b/UI7KitCatalog/Catalog.storyboard index 49326d0..9aa7274 100644 --- a/UI7KitCatalog/Catalog.storyboard +++ b/UI7KitCatalog/Catalog.storyboard @@ -1,8 +1,8 @@ - + - + @@ -1112,6 +1112,16 @@ Builder + diff --git a/UI7KitCatalog/UICPickerViewController.h b/UI7KitCatalog/UICPickerViewController.h index 3b830cd..627b530 100644 --- a/UI7KitCatalog/UICPickerViewController.h +++ b/UI7KitCatalog/UICPickerViewController.h @@ -12,5 +12,6 @@ @property(nonatomic,retain) IBOutlet UIPickerView *pickerView; - (IBAction)toggleShowIndicator:(id)sender; +- (IBAction)selectToday:(id)sender; @end diff --git a/UI7KitCatalog/UICPickerViewController.m b/UI7KitCatalog/UICPickerViewController.m index edb4a31..0252db2 100644 --- a/UI7KitCatalog/UICPickerViewController.m +++ b/UI7KitCatalog/UICPickerViewController.m @@ -28,6 +28,13 @@ - (void)toggleShowIndicator:(id)sender { self.pickerView.showsSelectionIndicator = !self.pickerView.showsSelectionIndicator; } +- (void)selectToday:(id)sender { + NSDate *date = [NSDate date]; + [self.pickerView selectRow:date.components.year - 2000 inComponent:0 animated:YES]; + [self.pickerView selectRow:date.components.month inComponent:1 animated:YES]; + [self.pickerView selectRow:date.components.day inComponent:2 animated:YES]; +} + #pragma mark - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {