Share iPad & iPhone UI resources?

Discussion in 'iOS Programming' started by ArtOfWarfare, Jul 10, 2013.

  1. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #1
    I'd like to make an iPad and iPhone version of my app, but I'd like them to share resources. IE, I've made several static and prototype cells in the iPhone storyboard, how can I make the same assets be used in the iPad storyboard without my duplicating assets? I figure just like its a bad idea to duplicate source code in a project, it's a bad idea to duplicate layouts as then anytime you change one, you have to remember to go and change the other as well, or else you may end up with inconsistent branding and style between different platforms.

    Should I maybe define my cells in XIBs instead and then load those into the storyboards?
     
  2. xArtx macrumors 6502a

    Joined:
    Mar 30, 2012
    #2
    It's a nice idea.
    I'm doing a little something with Borland C for Windows at the moment.
    Something I liked, was that I can define a property that causes the
    program to open in the middle of the screen, no matter what the screen size.

    I wondered the same thing, if it would be possible to create one somewhat dynamic interface
    if all of the iOS objects had properties like that.
    I suppose you could (perhaps) get the screen size,
    do the math, and move all the objects yourself.

    I was really lazy in my current one, by drawing on a bitmap, and then
    stretching that to the size of the iPhone it is running on.. but it only applies to the intro.
     
  3. dantastic macrumors 6502a

    dantastic

    Joined:
    Jan 21, 2011
    #3
    This kind of thing has really been bastardized by IB. You can draw these image views through code using scalable images (capped) and they will scale right to any view and no need to have one nib for iphone and one for ipad.
    The other thing you can do, which I have just started doing, is draw the images as view through code instead. In the apps I'm responsible for there are a lot of images that are PNGs cut from SVGs and in many cases there are many many copies of the same image pretty much. I've started an effort to draw as many as possible through code instead, this has actually solved a lot of the traditional IB problems.
     
  4. xArtx macrumors 6502a

    Joined:
    Mar 30, 2012
    #4
    Third app in review, and still haven't used an iOS interface (not even a button) :D
    Even though they say you should use their stuff to make apps look uniform.

    For my first app, I ripped the graphics of iOS buttons,
    loaded them as pngs, and still handled touches myself.
     
  5. ArtOfWarfare thread starter macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #5
    I found this on Stack Overflow... It looks like I might be able to find a way to have it work for my problem, but I haven't had the time to try applying it in my project yet:

    http://stackoverflow.com/a/10298648/901641
     
  6. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #6
    I'm only now getting into Storyboards in a big way. I've only played with static cells and cell prototypes a little bit. My memory is that prototype cells are loaded from an XIB, even in storyboards. How do you do load prototype cells from a storyboard?
     
  7. ArtOfWarfare thread starter macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #7
    I'm pretty sure you make your prototype cells directly in the storyboard normally...
     

Share This Page