I have a preview layer which shows the camera preview, using AVFoundation. Now I want to start my app such that everything is in landscape mode. How do I do that for the preview layer?
setorientation:
method is deprecated for iOS 6 so I don't want to use that.
The setVideoOrientation
method of AVCaptureConnection
changes the actual way the images are captured but the preview orientation still remains the same.
Copyright Notice:Content Author:「neeraj」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/13081080/preview-layer-orientation-ios