Вопрос

For development reasons, I started developing a universal iOS app, but want to launch with the iPhone version only first.

Besides modifying the “Targeted Device Family” to “iPhone” in the build settings, are there any more necessary steps to prevent users opening the already developed iPad classes/views on their iPad?

Moreover, is there a possibility for users (e.g. with jailbroken devices) to enter the app in iPad mode on their iPad? (How) Can this be prevented?

Это было полезно?

Решение 2

The answer to this varies based on how you've set up your existing code. If for example, you perform run time checks for the current hardware E.g if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) and change the UI based on the result of this, then you'll have to redo some code because even if the app only has an interface for iPhones, that condition would still evaluate true on an iPad.

Then another option is to have your classes split between interfaces. This is probably the best method when done right. By that I mean really sticking to the MVC paradigm and making your two interfaces separately, then linking each to its own controller object and then putting as much reusable logic for your app in one universally accessible object somewhere.

If you're done this the second way I've mentioned, you shouldn't have any trouble. Simply by pointing the project toward a storyboard for the iPhone/iPad versions of the project, the correct class files are loaded etc. Which leads me to the direct answer to your question.

Modifying the "Targeted Device Family” is all you really have to do provided you've set up your project in the second way I listed. And furthermore, there shouldn't be any concern that jailbroken users will access the iPad files. They can get in, but they're all compiled anyway and 99% of people don't know what to do with that big blob of gibberish.

And even if they did, I don't think anyone is going out of their way to try to find iPad versions of iPhone only apps. They know that if an app has a completed iPad version, it will just run on their iPad.

Другие советы

You can put a condition like :

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){

--- do something--

}

and comment out the calls for loading iPad classes and views

you do not need something else besides modifying "Targeted Device Family" property. I see little possibility that launching iPad mode is possible even on jailbreaked devices, but you can, for example, remove iPad files (and dependencies for them) from your project for iPhone build. I still think this is not necessary step.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top