I created an UIAlertController
let alertC = UIAlertController(title: \"Title\", message: \"Message\", preferredStyle: UIAlertControllerStyle.Alert)
alertC.ad
Swift 5
let alert = UIAlertController(title: "Title", message: "New Message", preferredStyle: UIAlertController.Style.alert)
let height:NSLayoutConstraint = NSLayoutConstraint(item: alert.view!, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: 350)
alert.view.addConstraint(height)
let okAction = UIAlertAction(title: "Done", style: .default, handler: {
(alert: UIAlertAction!) -> Void in
// Perform Action
})
alert.addAction(okAction)
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
alert.addAction(cancelAction)
self.present(alert, animated: true, completion: nil)