Including VLCKit prevents device rotation
I started working on implementing VLCKit in an existing (iOS) app and noticed that after including it, the app wouldn't rotate to landscape anymore. So I created a project from scratch and included VLCKit through CocoaPods. The same problem exists here.
What I found out:
- It does not happen on simulator, only on real device
- Tested on iPhone XR, iOS 15.6.1
- It happens only (as far as I can tell) when running through Xcode in debug
- The issue is also reproducible in VLCKit 4.0.0a
-
UIDevice.current.orientation
always returns 0 (= "Unknown") - When showing a modal and closing it through a swipe gesture, the device rotation to landscape again. (Sound weird, but I guess some animation is triggering this change, not sure). After that,
UIDevice.current.orientation
correctly returns the devices orientation.
Sample project at https://github.com/SystemKeeper/VLCKitRotationTest. The project was created from scratch and only added some labels/informations to demonstrate the issue. It show the current device orientation as reported by UIDevice.current.orientation
as well as motion information from CMMotionManager
to illustrate that the device was indeed turned. If you remove VLCKit it works again instantly.
To illustrate the issue, I created the following video.