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