Force landscape mode in one ViewController using Swift

后端 未结 19 1244
情书的邮戳
情书的邮戳 2020-12-02 07:44

I am trying to force only one view in my application on landscape mode, I am calling

override func shouldAutorotate() -> Bool {
    print(\"shouldAutoro         


        
19条回答
  •  北海茫月
    2020-12-02 07:55

    I needed to force one controller into portrait orientation. Adding this worked for me.

    swift 4 with iOS 11

    override var   supportedInterfaceOrientations : UIInterfaceOrientationMask{
    
        return  .portrait
    
    }
    

提交回复
热议问题