I'm writing a custom modal presentation using iOS 8's UIPresentationController. The controller being presented has a preferred interface orientation UIInterfaceOrientationLandscapeLeft
.
Upon presentation of this controller with a UIPresentationController, it is shown in portrait, ignoring the result of the presented controller's preferredInterfaceOrientationForPresentation method.
Presenting View Controller
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if let controller = segue.destinationViewController as? UIViewController {
controller.modalPresentationStyle = .Custom
controller.transitioningDelegate = self
}
}
func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return nil
}
func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return nil
}
func presentationControllerForPresentedViewController(presented: UIViewController,
presentingViewController presenting: UIViewController!,
sourceViewController source: UIViewController) -> UIPresentationController? {
return UIPresentationController(presentedViewController: presented, presentingViewController: presenting)
}
Presented View Controller
override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {
return .LandscapeLeft
}
Is it possible to have UIPresentationController take into account the result of the presented controller's preferredInterfaceOrientationForPresentation method?