RawMean
RawMean

Reputation: 8735

iOS: how to require app to only run on 4" display

I have developed a painting app that requires the larger 4" display on iPhone (3.5" is too small for it to be useful). Is there a way to prevent it from being installed on the older 3.5" devices?

Upvotes: 0

Views: 79

Answers (3)

Pawan Rai
Pawan Rai

Reputation: 3444

i per my knowledge , app run with there deployment target, not with there screen size. i thing you should make your app target to 7.0 with support from iphone 4.0 (onward). if you want specially to run on only iphone larger then 4 inch then add the line to #define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON ) in pch file & make a check in application did finish launching with option method . and if not found exit app.(but i thing its against ios app development guideline).

Upvotes: 0

erdekhayser
erdekhayser

Reputation: 6657

This macro lets you determine if the screen is large:

#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )

If you are using storyboards, auto layout can help you make the smaller screen still usable. Look here for more about this.

You should definitely make sure the app is usable for both screen sizes. In the future (maybe larger screens?) it will be even more important to support a range of screen sizes.

Upvotes: 1

levidhuyvetter
levidhuyvetter

Reputation: 411

As the comment on your question says, you should definitely try to make it useful for 3.5" devices as well. Especially when you are going to submit it to the app store, because a lot of people are still using iPhones with 3.5" screens.

If that's not an option, you could use UIScreen to determine the size of the screen, and depending on the size disable use of the application, or inform the user with an alert that it could be less useful.

UIScreen Class Reference

Upvotes: 3

Related Questions