I have an iPhone only app. But there are use cases where app is run on iPad. For eg. apple tests it on iPad.
I am struggling with getting device rotation right for iPad. Its very different from iPhone.
The idiom solution will not works as it returns iPhone even for iPad
So I wanted to at least force portrait only for iPad devices.
So I did following:
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
if ([[UIDevice currentDevice].model rangeOfString:@"Pad"].location != NSNotFound) {
return UIInterfaceOrientationMaskPortrait; /* Device is iPad */
}
return UIInterfaceOrientationMaskAll;
}
Can use the above solution reliably?