I am using the new UIAlertController
to implement an options menu of sorts for my application. I am trying to get the background color of the UIAlertController
to match the theme of the rest of my application. The theme for my application is pretty simple, and consists of white text with a blue/grey background color for the toolbar and navigation bar, shown below:
However, I am having some trouble trying to get my UIAlertController
to conform to this theme. I made the the following two calls to set the text and background color:
uiAlertController.view.backgroundColor = UIColor(red: CGFloat(.17255), green: CGFloat(.24314), blue: CGFloat(.31373), alpha: CGFloat(1.0))
uiAlertController.view.tintColor = UIColor.whiteColor()
This changed the UIAlertController
to look like below:
The text was changed from the default blue system color to white, but the background color is not correct. I also tried modifying the specifying opacity (uiAlertController.view.opaque = true
) but this did not help either. How do I go about setting the background color so it matches my navigation bar and toolbar? Thanks