I have a simple camera app, that has a AVCaptureVideoPreviewLayer inside a View.
I also have a button that triggers the AVCaptureSession to swap input between the rear and the front cameras.
I’d love to cause a flip animation when the change happens but I can’t work out how to do it…
I was thinking I’d try and overlay a freezeframe of the AVCaptureVideoPreviewLayer and then transition this layer swapping back with the AVCaptureVideoPreviewLayer.
Any pointers would really be gratefully received
If your
AVCaptureVideoPreviewLayeris inside aUIView, you should probably make a transition with thisUIView.Use one of these methods:
http://developer.apple.com/library/ios/#documentation/uikit/reference/uiview_class/uiview/uiview.html
With
UIViewAnimationOptionsset onUIViewAnimationOptionTransitionFlipFromLeftorUIViewAnimationOptionTransitionFlipFromRight