I am developing an iOS app for 4-inch screen. That means my app looks terrible on 3.5-inch screen because of images. If I published it in App Store, would it be possible to download this application for 3.5-inch iphone users? If I want to make a version of my app for 3.5-inch screens, should I just make two different projects?
Asked
Active
Viewed 94 times
0
-
1Have you heard of auto layout? – Prince Agrawal Feb 24 '14 at 15:25
-
1or struts / springs, or using -568h@2x in the file name for only 4 inch phones? – Simon McLoughlin Feb 24 '14 at 15:28
1 Answers
2
No, you can't stop people with a 3.5'' device downloading, however:
You can support both 4'' and 3.5'' devices with the same application.
You need to programmatically check which device you're currently running on and then layout your UI appropriately.
As a simple example, you can check if you're on a 4'' device (iPhone 5, 5C, 5s) with the below code snippet:
#define isFourInch ([[UIScreen mainScreen] bounds].size.height == 568)?TRUE:FALSE
if (isFourInch)
{
//4'' screen detected
}
else
{
//3.5'' screen detected
}
Because iOS 7 supports devices with 3.5" screens, you can't use the only-support-iOS-x technique.
Also, there isn't a setting in Xcode or a key for UIRequiredDeviceCapabilities which allows you to make the app 4-inch only.

Woodstock
- 22,184
- 15
- 80
- 118
-
1In all honesty I would use `#define IS_WIDESCREEN ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )` this sort of detection over checking just the bounds, but that is personal preference. – Popeye Feb 24 '14 at 15:30
-
1
-
1Your answer wasn't wrong I was just noting an alternative based on personal preference but +1 for the update. – Popeye Feb 24 '14 at 15:54
-
Be careful using this with iPhone 6 because the else will catch iPhone 4 and iPhone 6, 6 Plus. – mootymoots Sep 18 '14 at 18:25