Rotating only affect one time in iPad in swift 3

2019-08-27 18:00发布

I have 2 view controllers. First view controller has many videos and when user clicks on the Video, then it will goes to second view controller.

When user reaches to second view controller, then the screen will rotate automatically to the landscape mode.


But, user rotates the device and the video display will rotates to portrait and cannot set to landscape mode anymore.

enter image description here

---------------------
I set some config in Project > General.
I would like to set landscape whatever the user rotates the device. Anyone help me please?

enter image description here

1条回答
地球回转人心会变
2楼-- · 2019-08-27 18:40

Add the below functions to your video view controller :

override var shouldAutorotate: Bool {
    return true
}

override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
    return .landscape
}
查看更多
登录 后发表回答