いつもお世話になっております。
基本的にPortraitで表示するアプリを作成していますが、
デザインの表示上どうしてもLandscapeで表示したい画面があります。
自動的に画面をPortraitからLandscapeにする方法が知りたいです。
【現状】
AppDelegateにて
func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask { return [UIInterfaceOrientationMask.Portrait, UIInterfaceOrientationMask.LandscapeRight] }
と縦横両方の指定とBool判定を使用し、TOP画面にてNavigationControllerを拡張しています。
extension UINavigationController { override public func supportedInterfaceOrientations() -> UIInterfaceOrientationMask { let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate if appDelegate.landscape == true { return UIInterfaceOrientationMask.LandscapeRight } else { return UIInterfaceOrientationMask.Portrait } } }
自分でiPhoneを動かせば横画面になるのですが、自分で動かさず、
特定の画面が表示されたら自動的にLandscape表示される方法を
ご存知であれば何卒ご教授ください。
よろしくお願いいたします。
あなたの回答
tips
プレビュー