I get this warning sometimes when calling UIAlert
Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior ()
code used:
    func alert (dictKey: String){
        print(dictKey)
        let alertController = UIAlertController(title: nil, message: promptsArr[dictKey], preferredStyle: .Alert )
        let OKAction = UIAlertAction(title: "OK", style: .Default) { (action) in
        }
        alertController.addAction(OKAction)
        if self.presentedViewController == nil {
            delay(1.0){
                self.presentViewController(alertController, animated: true, completion: nil)
            }
        } else {
            self.presentedViewController!
        }
 
    