我为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];
}
}