如何设置仅为一个VC显示的特殊备用横向视图?

时间:2014-02-14 13:31:00

标签: ios objective-c landscape-portrait alternate

我为NLViewController子类创建了纵向视图和备用横向视图。当我将设备从任何其他VC子类旋转到横向时,将为所有其他视图控制器子类显示此备用横向视图。如何在调用NLVIewController时包含仅显示此备用横向视图的语句?

-(void)orientationDidChanged: (NSNotification *)notification {
    UIDeviceOrientation devOrientation = [UIDevice currentDevice].orientation;
    if (UIDeviceOrientationIsLandscape(devOrientation)) {
        UIStoryboard *main = [UIStoryboard storyboardWithName:@"Main_iPhone" bundle:nil];
        LandscapeController *landscape = [main instantiateViewControllerWithIdentifier:@"landscape"];
        [self presentViewController:landscape animated:YES completion:nil];
    } else if (UIDeviceOrientationIsPortrait(devOrientation)) {
        [self dismissViewControllerAnimated:YES completion:nil];
    }
}

0 个答案:

没有答案