2017-02-02 19 views
0

にないviewControllerの向きを変更する方法は、readerVCの向きを縦向きと横向きにする方法があります。以下の例では、ストーリーボード

func loadReader(filePaht : String) { 

      let document = ReaderDocument(filePath: filePaht, password: nil) 
      if document != nil { 
       let readerVC = ReaderViewController(readerDocument: document) 
       readerVC?.delegate = self 
       readerVC?.modalTransitionStyle = UIModalTransitionStyle.crossDissolve 
       readerVC?.modalPresentationStyle = UIModalPresentationStyle.fullScreen 
       self.navigationController?.pushViewController(readerVC!, animated: true) 

       UIApplication.shared.isStatusBarHidden = true 
      } 
     } 

答えて

0

あなたは、サポートされているインターフェイスの向きを上書きすることができます。

override var supportedInterfaceOrientations: UIInterfaceOrientationMask { 
    return .all 
} 

それともできreturn .allButUpsideDownreturn .portraitを - あなたが指定したいものは何でも。

+0

これは機能しません – Khallad

関連する問題