Popup datepicker cuando el usuario presiona un button

Soy un principiante en ios, por favor ayúdame a mostrar un calendar emergente cuando el usuario presiona un button. Ya tengo mi button debajo

UIButton *button=[UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame= CGRectMake(60, 560, 150, 30); [button setTitle:@"Select Date" forState:UIControlStateNormal]; [button addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside]; 

En el file .h

  UIDatePicker *datepicker; UIPopoverController *popOverForDatePicker; 

Configura el delegado en el file .h UIPopoverControllerDelegate

En file .m

 - (void)viewDidLoad { [super viewDidLoad]; UIButton *button=[UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame= CGRectMake(60, 560, 150, 30); [button setTitle:@"Select Date" forState:UIControlStateNormal]; [button setBackgroundColor:[UIColor networkingColor]]; [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:button]; } - (void)buttonAction:(UIButton *)sender { UIViewController *viewController = [[UIViewController alloc]init]; UIView *viewForDatePicker = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 200, 100)]; datepicker = [[UIDatePicker alloc]initWithFrame:CGRectMake(0, 0, 200, 100)]; datepicker.datePickerMode = UIDatePickerModeDate; datepicker.hidden = NO; datepicker.date = [NSDate date]; [datepicker addTarget:self action:@selector(LabelChange:) forControlEvents:UIControlEventValueChanged]; [viewForDatePicker addSubview:datepicker]; [viewController.view addSubview:viewForDatePicker]; popOverForDatePicker = [[UIPopoverController alloc]initWithContentViewController:viewController]; popOverForDatePicker.delegate = self; [popOverForDatePicker setPopoverContentSize:CGSizeMake(200, 100) animated:NO]; [popOverForDatePicker presentPopoverFromRect:sender.frame inView:self.view permittedArrowDirections:(UIPopoverArrowDirectionUp|UIPopoverArrowDirectionDown| UIPopoverArrowDirectionLeft|UIPopoverArrowDirectionRight) animated:YES]; } -(void)LabelChange:(id)sender { NSDateFormatter *df = [[NSDateFormatter alloc]init]; df.dateStyle = NSDateFormatterMediumStyle; NSLog(@"%@",[NSString stringWithFormat:@"%@",[df stringFromDate:datepicker.date]]); }