Here is my code below. I keep getting the error: "Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior". Everywhere online says this code will work. Thoughts on why it doesn't work?
let alert = UIAlertController(title: "Alert: iCloud Disabled", message: "Go into Settings -> iCloud -> iCloud Drive and switch iCloud Drive to On.", preferredStyle: UIAlertControllerStyle.Alert)
let OKAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: {
(_)in
self.networkAlertDisplayed = true
self.performSegueWithIdentifier("unwindToController1", sender: self)
})
alert.addAction(OKAction)
self.presentViewController(alert, animated: true, completion: nil)
What do I need to do to get this code working?