I'm trying to add a UIAlertView or Controller when the app first loads. Currently, I have this code in my viewDidLoad
method.
let welcomeAlert = UIAlertController(title: "hola", message: "this is a test.", preferredStyle: UIAlertControllerStyle.Alert)
welcomeAlert.addAction(UIAlertAction(title: "ok.", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(welcomeAlert, animated: true, completion: nil)
Why won't the alert view display? I used the same code but inside of an IBAction
for a button, and it works as expected.