I have been doing some experiments with a custom camera using AVFoundation and so far everything's been great. The AVCam example got me very far and I am quite happy with the results.
However, one thing I still don't get is how the iOS default Camera app handles rotations. It seems like the background does not rotate at all but all the overlay controls do.
This is probably not a camera-specific question but how could I achieve this behaviour?
TLDR: Have a background camera layer, controls on top, how to rotate controls without rotating the background layer?
I've been wondering on the same...
My guess would be that the native Camera viewController doesn't rotate using the UIViewController
rotation mechanism
Rather it must call [UIDevice beginGeneratingDeviceOrientationNotifications]
and handle specific UI update (grey buttons fading position switching, and toolbar buttons image rotation)
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(yourUpdateMethodForRotation:) notificationName: UIDeviceOrientationDidChangeNotification];
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