iPhone 6 の AppDelegate.m に UIScreen 境界コードを追加したところ、iPhone 6 のデバイスの向きが縦向き/上下逆向きに機能しなくなりました。Upside Down は、シミュレーターとデバイスで機能しないものです。
AppDelegate.m のコード
CGSize iosScreenSize = [[UIScreen mainScreen] bounds].size;
if (iosScreenSize.height == 667) {
UIStoryboard *iPhone6 = [UIStoryboard storyboardWithName:@"iPhone6" bundle:nil];
UIViewController *initialViewController =[iPhone6 instantiateInitialViewController];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen]bounds]];
self.window.rootViewController = initialViewController;
[self.window makeKeyAndVisible];
}
上記のコードを含めたとき、iPhone 6 のシミュレーターとデバイスは上下逆さまの向きを検出しません。また、nativeBounds と screenBounds も使用しましたが、逆さまの向きでも機能しませんでした。
デバイスの向きの私のコード...
-(NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
iPhone 6 で UpSide Down の向きを検出できるように AppDelegate コードを取得する方法がわかりません。