title: Custom Alert view controller to select date in IOS
body: <p>I have a custom alert view controller to select date from date picker, but i'm confuse bit that how can i add two button in alert view controller and when user click the button than it shows the date picker in alert view controller and how can i change the color of alert view controller. My code is ,</p>
  
  <pre><code>UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"\n\n\n\n\n\n\n\n\n\n\n" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
  UIDatePicker *picker = [[UIDatePicker alloc] init];
  [picker setDatePickerMode:UIDatePickerModeDate];
  [alertController.view addSubview:picker];
  [alertController addAction:({
      UIAlertAction *action = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
          NSLog(@"OK");
          NSLog(@"%@",picker.date);
      }];
      action;
  })];
  UIPopoverPresentationController *popoverController = alertController.popoverPresentationController;
  popoverController.sourceView = sender;
  popoverController.sourceRect = [sender bounds];
  [self presentViewController:alertController  animated:YES completion:nil];
  </code></pre>
  
  <p>It looks like this,
  <a href="https://i.stack.imgur.com/sMMY9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sMMY9.jpg" alt="enter image description here"></a></p>