Orientation deprecated in iOS 6
iphone
Solution
Did you check the documentation? It's only one line:
The layer’s orientation. (Deprecated in iOS 6.0. Use videoOrientation (AVCaptureConnection) instead.)
so use:
[[AVCaptureVideoPreviewLayer connection] setVideoOrientation: AVCaptureVideoOrientationLandscapeRight];
or
AVCaptureVideoPreviewLayer.connection.videoOrientation= AVCaptureVideoOrientationLandscapeRight;
Problem
Looks like orientation for avcapturevideopreviewlayer has been depreciated in iOS 6. Anyone know the new code? Here is my current (depreciated) code: ``` [self setPreviewLayer:[[AVCaptureVideoPreviewLayer alloc] initWithSession:[self captureSession]]]; [[self previewLayer] setVideoGravity:AVLayerVideoGravityResizeAspectFill]; previewLayer.orientation = UIInterfaceOrientationLandscapeRight; ```