I created an UIAlertController
let alertC = UIAlertController(title: "Title", message: "Message", preferredStyle: UIAlertControllerStyle.Alert)
alertC.addTextFieldWithConfigurationHandler(addTextField)
alertC.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Default, handler: nil))
alertC.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: okButton))
presentViewController(alertC, animated: true, completion: nil)
But after that I would like to change the UIAlertController height? How can I do this?
Since I did not have a message to input I added lines with "\n \n \n" in the message field to make the alert controller height longer.
I found you can add constraints before you present the view controller
If this helps anyone, the accepted answer will change the height of UIAlertController, but not the width. So the better way to change both height and width of UIAlertController is change constraints on one of the subviews of UIAlertController rather than its view directly.
*NOTE: Do not forget to deactivate default width constraint, to avoid conflicting constraints. Default height constraint won't cause conflict with added height constraint. But you can remove default height constraint as well for coherent code.