I need block a screen. im using the next fuctions:
override func shouldAutorotate() -> Bool {
return false
}
override func supportedInterfaceOrientations() -> Int {
return UIInterfaceOrientation.Portrait.rawValue
}
but the problem is that i have a show alert function,
func showAlert(message: String) {
self.viewUtils.hideActivityIndicator(self.view)
let alertView = UIAlertController(title: "Oops", message: message, preferredStyle: UIAlertControllerStyle.Alert)
alertView.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: nil))
self.presentViewController(alertView, animated: true, completion: nil)
//activity.hidden = true
}
and when i call it i see the error:
Terminating app due to uncaught exception
'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES'