Observing change in UIDatePicker

You need to add to your UIDatePicker the UIControlEventValueChanged event to handle date changes:

[myDatePicker addTarget:self action:@selector(dateIsChanged:) forControlEvents:UIControlEventValueChanged];

Then the implementation:

- (void)dateIsChanged:(id)sender{
     NSLog(@"Date changed");
}

Leave a Comment