Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top