tardoandre tardoandre - 11 months ago 51
iOS Question

Why is my UIAlertController not being fired?

I want to display a

whenever user opens the application.

This is how I'm creating and trying to show it:

import UIKit

class ViewController: UIViewController {

override func viewDidLoad() {

//simple alert dialog
let alert=UIAlertController(title: "Alert 1", message: "One is awesome", preferredStyle: UIAlertControllerStyle.Alert);
//show it
showViewController(alert, sender: self);


Why is it not being displayed?


It will work if you'd use: presentViewController(alert, animated: true, completion: nil)