Convert iPhone app to Universal

Discussion in 'iOS Programming' started by thedon1, Aug 7, 2013.

  1. thedon1 macrumors 6502

    Joined:
    Jun 26, 2010
    #1
    Hi

    I am developing an iPhone app and would like to make it universal. Is there a step by step guide on what I should be doing to achieve this?

    I'm using storyboards and most guides out there are quite old and use xibs.

    Thanks
     
  2. waterskier2007 macrumors 68000

    waterskier2007

    Joined:
    Jun 19, 2007
    Location:
    White Lake, MI
    #2
    It is pretty simple as most of your "code" is there. First you should add a new file to the project. This should be a Storyboard file. I would name it "iPadStoryboard" or something. In your project settings, change the app to universal which will reveal a new section where you can specify iPad specific icons, and specify which storyboard the iPad version uses. Choose the iPadStoryboard file you created and then use that storyboard to layout your iPad version and make all the connections you would make just like the iPhone version.
     
  3. TouchMint.com macrumors 68000

    TouchMint.com

    Joined:
    May 25, 2012
    Location:
    Phoenix
    #3
    What about for apps that do not use storyboarding?

    Is it possible to storyboard the ipad side and not the iphone side?
     
  4. Twimfy macrumors 6502a

    Twimfy

    Joined:
    Sep 11, 2011
    Location:
    UK
    #4
    Not sure. I never use StoryBoarding, call me old fashioned but it's just too easy for me, can't beat a good old fashioned .xib although I'm sure I'll get bashed with many a reason as to why I should change my mind.

    Anyway I find the easiest way to do it (it of course depends on the kind of app you're building) is just get the view controllers to load a different .xib dependent on the device type (there are many ways you can do this). Then you can just duplicate your existing .xib, change the dimensions to iPad size and change the files owner to whatever you want, as long as the if statement controlling the loading of either an iPhone or iPad .xib knows to load it.

    It's a dirty hack but I've used it for a long time and find it works well and I can keep control of my project a lot easier. (a lot of my older apps use many hand dropped interface builder elements and no dynamic layouts).
     
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    So, no auto-layout either?
     
  6. TouchMint.com macrumors 68000

    TouchMint.com

    Joined:
    May 25, 2012
    Location:
    Phoenix
    #6
    I dont plan on using storyboard ever either haha. Anyways thanks for the idea I will give it a try with one of my more simple apps.

    ----------

    I think there is an issue with auto-layout and support before ios5. I dont use auto layout on my stuff either.
     
  7. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #7
    Are you supporting iOS 4 and earlier?
     
  8. TouchMint.com macrumors 68000

    TouchMint.com

    Joined:
    May 25, 2012
    Location:
    Phoenix
    #8
    4.3 and up on my stat tracking app. I compete with ESPN on a few of my stat trackers so I need all the reach I can get haha. I honestly could drop it without much of a loss but I find it easy to manually move elements around when accounting for a 3.5inch screen.
     
  9. Twimfy macrumors 6502a

    Twimfy

    Joined:
    Sep 11, 2011
    Location:
    UK
    #9
    That all depends on the App, I will use it when it behaves nicely.
     
  10. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #10
    I have the same feeling. Sometimes it works very nicely but other times it can be just so frustrating. I watch the WWDC videos and they make it look so easy. Then I try to reproduce, say, a table-cell label-value layout that scales nicely and get nothing but warnings.
     

Share This Page