Swift manually rotate view controller

柔情痞子 提交于 2019-12-08 04:23:26

iOS encourages developers to support both portrait and landscape, so it can be difficult to restrict one part of the app to be landscape while the other is portrait.

One option that works pretty well is to restrict the entire app to portrait mode in the project settings, and apply a rotation transform to any view controllers that need to be landscape. This way, the view will look and behave like it is landscape, and you have full control over the rotation of your views.

Can you apply below code on the required customCameraView Controller :

override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
    return UIInterfaceOrientationMask.landscapeLeft
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!