Вопрос

Im trying to the set the orientation of my app so that it rotates when it is playing a video. Changing the "Supported Interface Orientations" in info.plist changes the orientation for the whole app but I just want it to change orientation when a video is playing. Any ideas of how to do this?

Это было полезно?

Решение

You can use CoreMotion to detect the current interface orientation, and the only change interface orientation if your video is playing.

Try checking out the CMMotionManager class.

Alternatively, try checking out preferredInterfaceOrientationForPresentation on your UIViewController.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top