我目前的观点是肖像,显示特定的设计。当我横向旋转它时,我想切换到一个新设计,特别是一个新的ViewController,带有新的.h / .m文件。
我应该这样接近吗?有人能指出我正确的方向吗? 旋转可以触发segue吗?
答案 0 :(得分:0)
-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
NSLog(@"Landscape left");
//Present or dismiss your new view controller accordingly
} else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
NSLog(@"Landscape right");
//Present or dismiss your new view controller accordingly
} else if (toInterfaceOrientation == UIInterfaceOrientationPortrait) {
NSLog(@"Portrait");
//Present or dismiss your new view controller accordingly
} else if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
NSLog(@"Upside down");
//Present or dismiss your new view controller accordingly
}
}