title: Customize button of uialertcontroller ios
body: <p>Is there any way to customize the <code>buttons</code> of <code>uialertcontroller</code>? I have seen how to customize font, size and color but cannot add a background image or color of uialertcontroller button.</p>
  
  <pre><code>    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil
                                                                           message:nil
                                                                    preferredStyle:UIAlertControllerStyleAlert];
  UIViewController *v = [[UIViewController alloc] init];
  v.view.backgroundColor = [UIColor cyanColor];
  
  [alertController setValue:v forKey:@"contentViewController"];
  
  UIAlertAction *selectImage = [UIAlertAction
                                  actionWithTitle:@"First Button"
                                  style:UIAlertActionStyleDefault
                                  handler:^(UIAlertAction *action){
  
                                      NSLog(@"First Button");
  
                                  }];
  
  [alertController addAction:selectImage];
  
  UIAlertAction *addImage = [UIAlertAction
                                   actionWithTitle:@"Second Button"
                                   style:UIAlertActionStyleDefault
                                   handler:^(UIAlertAction *action) {
  
                                       NSLog(@"Second Button");
  
                                   }];
  [alertController addAction:addImage];
  
  alertController.view.tintColor = [UIColor redColor];
  
  UIView *subView = alertController.view.subviews.firstObject;
  UIView *alertContentView = subView.subviews.firstObject;
  [alertContentView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]]];
  
  alertContentView.layer.cornerRadius = 5;
  
  [self presentViewController:alertController animated:YES completion:nil];
  </code></pre>
  
  <p>Please suggest if there is any way to set background image of buttons.</p>