nick
nick

Reputation: 2843

Convert iPad app to universal or rewrite

I know it's possible to convert an iPad app to a universal app, my question is is it worth it.

All the app does, is it shows an initial screen with a list of servers that it detects using UDP broadcasts. Once a user clicks on one, it loads a page from that server into a UIWebViewControl. That's it. It's pretty simple. I've looked at converting an exiting iPad app to a universal app and don't really like the process. My main hang up is understanding interface builder without the convenience of storyboard, especially the way the original coder had set it up. I'm also not sure how to make the app load a different view for the iPhone / iPod than it does for the iPad.

That being said, should I convert the app or just re-write it?

Upvotes: 1

Views: 1046

Answers (2)

WrightsCS
WrightsCS

Reputation: 50697

Your Universal convert should be effortless. Your iPad users would appreciate the work. But definitely convert it unless you are planning on adding some major UI changes in which a rewrite would be beneficial.

In an easy way to determine iPad code from iPhone code, use:

#define IDIOM    UI_USER_INTERFACE_IDIOM()
#define IPAD     UIUserInterfaceIdiomPad
#define IPHONE   UIUserInterfaceIdiomPhone

In regards to the above IDIOM, I have seen Apple use the following in iOS 5.1:

[[UIDevice currentDevice] userInterfaceIdiom]

So you can also use

#define IDIOM    [[UIDevice currentDevice] userInterfaceIdiom]

Example

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    if ( IDIOM == IPAD ) {
        /*  Device is an iPad, so let the interface rotate.  */
        return YES;
    }else{
        /*  Device is an iPhone / iPod touch, so do not allow the interface rotate.  */
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }
    return YES;
}

Upvotes: 2

Hermann Klecker
Hermann Klecker

Reputation: 14068

If the app is that small then start from scratch. You may copy most of the old code over if you think it is worth doing so.

Upvotes: 1

Related Questions