Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

techwoman

macrumors newbie
Original poster
Nov 22, 2014
29
0
USA
I created an app and am able to open it both in iPhone and iPad. I want to support the app only on iPhone.

Is there a way to remove the support for iPad programmatically?
 
In the project pane in Xcode if you scroll down, there's a simple checkbox that enables iPhone and iPad support respectively. There are also options for orientations so you can lock certain orientations.
[doublepost=1513698462][/doublepost]Sorry, misremembered. Not a checkbox but a dropdown. Here's a screenshot
 

Attachments

  • Screen Shot 2017-12-19 at 4.47.04 PM.png
    Screen Shot 2017-12-19 at 4.47.04 PM.png
    986.2 KB · Views: 403
  • Like
Reactions: techwoman
In the project pane in Xcode if you scroll down, there's a simple checkbox that enables iPhone and iPad support respectively. There are also options for orientations so you can lock certain orientations.
[doublepost=1513698462][/doublepost]Sorry, misremembered. Not a checkbox but a dropdown. Here's a screenshot

That helped... Thanks!
 
Is there a way to remove the support for iPad programmatically?

You can remove layout support for the iPad as Casperes mentioned. If you do this the App would not appear in the App Store when searching for iPad apps. Something in the back of brain says that you can do it in code, but the App Store wouldn’t know about that.

If you were to remove execution capability on the iPad via code, that would break expected behavior and like piss off your users.
 
If you were to remove execution capability on the iPad via code, that would break expected behavior and like piss off your users.


There's probably some private API for this, but I doubt that there's any official way to do this as a global toggle for the entire app. As you say it doesn't exactly lead to a good experience if the app is marked as universal in the app store and doesn't start on iPad. But there are definitely ways of detecting the device type and changing the code path based on it. See for example Spotify. It's a universal app; The free tier only allows shuffling on iPhone but allows freely picking songs on the iPad. Of course it is possible they do this merely by running the code from different view controllers for the iPad layout vs. iPhone layout and that they don't actually use any API that checks for device type. Just seems like that method would bee more prone to hacks although I can't think of a way to trick the iPhone layout into thinking the UI elements are from an iPad or whatever.
 
You're welcome :). What kind of app did you make and is it going live or is it practice or?

I am working on making my personal apps and planning to push it to live. I have ideas for bigger apps, but for now have started with smaller apps so that I could get my feet wet and practice in iOS. :)
 
Unless your app uses telephony features, Apple will likely reject it if it does not run on an iPad. The reason? They have been known to use the 1X/2X iPhone emulation mode on an iPad to test app submissions. If it fails app review this way, it's a guaranteed rejection. Thus any app you submit has to at least run properly on the 1X/2X iPhone emulator that is built into iOS on every iPad.
 
Unless your app uses telephony features, Apple will likely reject it if it does not run on an iPad. The reason? They have been known to use the 1X/2X iPhone emulation mode on an iPad to test app submissions. If it fails app review this way, it's a guaranteed rejection. Thus any app you submit has to at least run properly on the 1X/2X iPhone emulator that is built into iOS on every iPad.

That's entirely unrelated - doing what I said above will tell the App Store that you don't have a layout made for iPad and it shouldn't show the app as available for iPad in the App Store - you can still download the iPhone version of it onto the iPad and run it the way you say.
 
  • Like
Reactions: albebaubles
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.