我正在展示一个UIAlertController
并且UIAlertAction
我正在解雇视图控制器。它在 iOS 9.3 之前运行良好。但在 iOS 9.3 中它不起作用。以下是代码。
let alertController = UIAlertController(title: "Logged In Successfully", message: "asda", preferredStyle: .Alert)
// Create the actions
let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default) { UIAlertAction in
self.dismissViewControllerAnimated(true, completion: nil)
}
// Add the actions
alertController.addAction(okAction)
// Present the controller
self.presentViewController(alertController, animated: true, completion: nil)