So I currently have a camera app. I have it so it only works in portrait mode but you can still record videos and take photos in landscape mode fine. I use the following code to handle that:
videoConnection?.videoOrientation = self.orientation()
However, since the app does not register landscape mode itself you can not record the screen via quicktime in landscape (it stays portrait) (quicktime>file>record movie>choose device name)
Is there a way to fix this? I don't need to actually change the anything about the device to support landscape, I just want the ability to be able to record it that way in quicktime but nothing in the UI needs to be changed.
You can set call beginGeneratingDeviceOrientationNotifications
for UIDevice
and subscribe to UIDeviceOrientationDidChangeNotification
. Afterward you can use orientation property of UIDevice
in your code.
Reference Apple documentation for UIDevice class for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With