Adding A New Target In Xcode App....

Discussion in 'iOS Programming' started by TrentS, Nov 30, 2015.

  1. TrentS macrumors 6502

    TrentS

    Joined:
    Sep 24, 2011
    Location:
    Overland Park, Kansas
    #1
    I have created an iPad app in Xcode, and now want to make a new target inside the app for an iPhone version. When I name the new target, should I put "iPhone" on the end of the name, so I can distinguish this new target from the old target, or can you not put "iPhone", "iPad" into the new targets name?

    If Apple doesn't allow this, then how do you distinguish the new target from the old target?
     
  2. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #2
    Why would you make two targets? If it's the same app then there's no reason to, you can make a universal app that works with both. It is possible to have two storyboards, one for iOS and one for iPad if you like.

    Having two targets for iPad/iPhone would be a real mess.
     
  3. TrentS thread starter macrumors 6502

    TrentS

    Joined:
    Sep 24, 2011
    Location:
    Overland Park, Kansas
    #3
    I didn't use storyboards to make the app, it's all done in code. In my case, how can I make an iPhone version within the same iPad project, isn't that what multiple targets are for?
     
  4. AxoNeuron macrumors 65816

    AxoNeuron

    Joined:
    Apr 22, 2012
    Location:
    The Left Coast
    #4
    That's pretty old school ;)

    How are you drawing to the display? Perhaps you could call
    [[UIDevice currentDevice] platformString] and then perform different logic based on whether the resulting string begins with 'iPhone' or 'iPad'.
     
  5. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #5
    The recommended way to do this is with a Universal app that runs on both platforms. As of iOS 8 Apple is recommending that developers write Adaptive Interfaces that change based on size classes and not on the interface idiom (iPad vs iPhone). This will build an app that runs on devices like iPhone 6+ and future devices that may not fit into the iPhone/iPad sizes in simple ways.

    While it's possible to do this in code doing it with a storyboard makes much more sense.
     
  6. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #6
    Thinking out loud I'd think you'd have to create two App IDs and distribution profiles for each of those and associate the profiles with the appropriate target. Also each target needs its Bundle Identifier set to match the app id.

    The only good reason I can think of to create unique iPhone and iPad versions is for revenue. You gain in those cases where customers want you app on both types of devices.

    Being unique apps I would think could limit data sharing, at least when using the Apple sharing techniques.
     
  7. firewood, Dec 1, 2015
    Last edited: Dec 1, 2015

    firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #7
    You can name the targets anything you want: "Target 1" and "Target 2" will work The app supported device(s), product name, bundle ID, and text under the icon can all be set separately.

    I've put well over a half dozen different Targets inside a single Xcode Project (iPhone-only, iPad-only, Universal, Free-Lite, Paid, Pro, just-for-testing-using-private-APIs, etc.) that share mostly the same code. Not all get submitted of course, after market analysis.

    I do some iPad-only versions of apps because I've found that one can set the price higher for iPad apps and still get similar downloads, thus higher total revenue, without decreasing iPhone downloads.
     

Share This Page