title: Swift UIAlertController background color
body: <p>I'm implementing a custom alert where I set a color for the background. The code below works perfectly when I squeeze it in the simulator, but when I test on the iPhone the custom background is superimposed by the pattern as shown below.</p>
  
  <pre><code>let alertController = UIAlertController(title: "Opções", message: "Deseja realmente excluir esse serviço?", preferredStyle: .Alert)
  alertController.setValue(NSAttributedString(string: "Opções", attributes: [NSFontAttributeName : UIFont.systemFontOfSize(17),NSForegroundColorAttributeName : UIColor.whiteColor()]), forKey: "attributedTitle")
  alertController.setValue(NSAttributedString(string: "Deseja realmente excluir esse serviço?", attributes: [NSFontAttributeName : UIFont.systemFontOfSize(17),NSForegroundColorAttributeName : UIColor.whiteColor()]), forKey: "attributedMessage")
  
  alertController.view.tintColor = UIColor.whiteColor()
  let backView = alertController.view.subviews.last?.subviews.last
  backView?.layer.cornerRadius = 5.0
  backView?.backgroundColor = corAzul
  backView?.alpha = 1.0
  let imageView = UIImageView(frame: CGRectMake(10, 15, 30, 30))
  imageView.image = UIImage(named: "load")
  alertController.view.addSubview(imageView)
  
  let Action2 = UIAlertAction(title: "Excluir", style: .Default) { (action) in
      Excluir()
  }
  let Action7 = UIAlertAction(title: "Cancelar", style: .Cancel) { (action) in
      Cancelar()
  }
  alertController.addAction(Action2)
  alertController.addAction(Action7)
  viewController.presentViewController(alertController, animated: true) {}
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Ognr6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ognr6.png" alt="enter image description here"></a></p>
  
  <p>What can cause this? And how can I solve it?</p>