I need a simple alert that pops up when the view loads on the screen. I've found a couple of tutorials on how to create a pop-up alert but they all require that a UIbutton is pressed. I need it to just automatically pop up when the view loads.
This is a start to my code, however I can't figure out how to call upon the code without having to use a UIbutton action:
override func viewDidLoad() {
super.viewDidLoad()
let alertController = UIAlertController(title: "Disclaimer", message:
"Hello, world!", preferredStyle: UIAlertControllerStyle.Alert)
alertController.addAction(UIAlertAction(title: "Accept", style: UIAlertActionStyle.Default,handler: nil))
self.presentViewController(alertController, animated: true, completion: nil)