Reputation: 1922
My iPhone only app has been rejected for the following reason provided by Apple:
We noticed that your app did not run at iPhone resolution when reviewed on iPad running iOS 9, which is a violation of the App Store Review Guidelines.
I now understand that the iPad has its own iPhone simulator that you can run iPhone apps on. After initial debugging, I noticed that, when testing on the iPad Air (iOS 9.0), my iPhone 5 storyboard is being used in its own iPhone simulator.
This is how it looks (correctly) on the iPhone 5:
https://i.sstatic.net/SMHyx.png
And this is how it looks (incorrectly) on the iPad:
https://i.sstatic.net/2PHG4.png
Since the iPad is using my iPhone 5 storyboard, why isn't it scaling everything correctly? How do I fix this?
*****EDIT*****
I have discovered that I made a mistake when debugging and the iPad's iPhone simulator has a display height of 480, which is the size of an iPhone 4. My code below was causing my iPhone 6+ storyboard to be shown:
CGSize result = [[UIScreen mainScreen] bounds].size;
//get the right storyboard for the device.
if(result.height == 568)
{
storyBoard = [UIStoryboard storyboardWithName:@"iPhone5" bundle:nil];
NSLog(@"IPHONE 5 STORYBOARD!");
}
else if(result.height == 667)
{
storyBoard = [UIStoryboard storyboardWithName:@"iPhone6" bundle:nil];
NSLog(@"IPHONE 6 STORYBOARD!");
}
else //iPhone 6+
{
storyBoard = [UIStoryboard storyboardWithName:@"iPhone6Plus" bundle:nil];
NSLog(@"IPHONE 6+ STORYBOARD!");
}
However, I thought I made my app for only iPhone 5 and up by setting it to iOS 8 and up, meaning that I don't have an iPhone 4 storyboard. How do I solve this issue?
Upvotes: 0
Views: 716
Reputation: 52602
You solve the problem by either supporting the iPad properly (have an iPhone + iPad application), or by supplying a storyboard for 3.5 inch - alternatively, using the 4 inch storyboard, using layout constraints properly, and perhaps adjusting some properties.
The obvious change for picking the right storyboard is to change: if (height <= 568) .. else if (height <= 667) ... else ... Your code says that everything that isn't 568 or 667 pixels high is a 6+, which as you can see is nonsense.
You could also just support the iPad and use the 6+ storyboard for the iPad. Again, using layout constraints properly.
Upvotes: 0
Reputation: 423
It is not possible otherwise to restrict your app on a per device basis. Since your app is iOS 8 and up, you will have to support iPhone 4S's resolution. Since iPhone 4S is getting iOS 9 too, you will have to support it in the near future too.
Upvotes: 2
Reputation: 1650
iPad always presents a view size equal to iPhone 4S or lower when you run iPhone app in iPad. So try to change your app in such a way that your app should work properly with iPhone 4 simulator or device.
Upvotes: 2