Kyle
Kyle

Reputation: 22055

How do I limit an iOS app only to 4 inch screen devices?

Is there a setting in Xcode that lets me declare that my app only supports 4" screen devices (iPhone 5 and the newest iPod Touch)?

Upvotes: 15

Views: 9747

Answers (3)

Mengli
Mengli

Reputation: 11

Yes. You may not be able to add a setting in Xcode or a key for requiredDeviceCapabilities which allows you to make the app 4-inch only. But you can allow the user launch the application first, then in the very beginning view controller detect screen size by using following code:

CGRect screenBound = [[UIScreen mainScreen] bounds];
CGSize screenSize = screenBound.size;
CGFloat screenWidth = screenSize.width;
CGFloat screenHeight = screenSize.height;

Last, based on the device screen size you preferred to run your app, you can either disable the next activity or continue.

Upvotes: 0

Sr.iOSDev
Sr.iOSDev

Reputation: 322

As you can see in below screenshot which is taken from Apple's official website, iPhone 4 and iPhone 4s are the ones with 3.5 inch screen and they do support iOS 7.

enter image description here

So you cannot constrain the app resolution support for 4 inch screen only by even using iOS 7.

Also as per the below forum there is no way we can just put application on app store that only supports 4 inch screen iPhone.

iPhone app for 4-inch screen only?

Let me know if you need more help.

Upvotes: 5

Undo
Undo

Reputation: 25697

Nope.

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 requiredDeviceCapabilities which allows you to make the app 4-inch only.

Upvotes: 23

Related Questions