相关疑难解决方法(0)

在iOS 8中不推荐使用"interfaceOrientation",如何更改此方法目标C.

我从Cocoa Controls下载了一个使用此方法的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;
}
Run Code Online (Sandbox Code Playgroud)

问题是在iOS 8中不推荐使用"interfaceOrientation"但我不知道在Switch条件中替换它的方法和方法.

cocoa-touch objective-c ios

73
推荐指数
2
解决办法
3万
查看次数

标签 统计

cocoa-touch ×1

ios ×1

objective-c ×1