我已经从可可控件下载了一个simpleCamera视图,该视图使用了这种方法
- (AVCaptureVideoOrientation)orientationForConnection
{
AVCaptureVideoOrientation videoOrientation = AVCaptureVideoOrientationPortrait;
switch (self.interfaceOrientation) {
case UIInterfaceOrientationLandscapeLeft:
videoOrientation = AVCaptureVideoOrientationLandscapeLeft;
break;
case UIInterfaceOrientationLandscapeRight:
videoOrientation = AVCaptureVideoOrientationLandscapeRight;
break;
case UIInterfaceOrientationPortraitUpsideDown:
videoOrientation = AVCaptureVideoOrientationPortraitUpsideDown;
break;
default:
videoOrientation = AVCaptureVideoOrientationPortrait;
break;
}
return videoOrientation;
}
问题是iOS 8中不推荐使用“ interfaceOrientation”,但我不知道该如何以及如何在Switch条件下替换它。