views:

730

answers:

4

I have an iPhone app and would like to create iPad version of it. What is the best way to setup the project when you want an iPhone and iPad version of the app?

I don't see that I'm able to use the same code base since the iPad version will have features in it that the iPhone version doesn't. It seems as though maintenance is going to go up with two similar code bases for the same app.

A: 

Since the features should be similar but the layout is separate, code base s/b ok but the ib should change - making things far simpler; now v4.0 is a different answer :)

KevinDTimm
A: 

Maintenance would go up a bit. But if you have your app written abstractly enough, it should be fairly easy to port it to other devices. (For example, if you never assume that you will always know the screen size, you should be able to change that fairly easily).

For other things, it may be a bit difficult. However, if you use the Model View Controller (MVC) paradigm of thinking, you should be able to develop both apps simultaneously with only about 1/3 of the extra work. (Keeping the same model and controller, and only swapping out the view, alternatively, you could include the controller in there, but I wouldn't).

Leif Andersen
+2  A: 

Refactor the common portions out and create a new target. You're the only one who really knows what the best way to do that is.

Azeem.Butt
This is the best way to do it for situations where (and remember this well) you wish to have 2 different apps. I have yet to be able to do a "universal" app that I am happy with. I much prefer 2 different targets for 2 different apps. I know purists will dislike this...and I did not choose this method easily, but it works for my apps.
Jann
A: 

I just went through this thought process this week myself, having a published iPad app which I wanted to create an iPhone version of, and I decided on using the universal app approach. I found it worked extremely well for my needs. Once you get past the project setup issues, and the tactics of design decisions of where and how you are going to split up your iPad/iPhone specific code, the universal app framework is pretty fabulous.

Along the way, I created a reusable universal app project template, which I then used as the starting point for my universal app. The code is open source, hosted on github, I encourage you to take a look at it as one way to approach your problem, knowing that it is a tested solution that worked for me. (Additionally, I welcome any contributions from anyone wanting to help make it a more useful project)

The github link is: http://github.com/ryanscott/rcloudlib/tree/master/Samples/rcuniversaltemplate/

In terms of maintenance, I am extremely happy with the minimal added work it takes to support both devices. Sure, it's more work than supporting just one or the other, but it is significantly less maintenance than two separate codebases, where the business & app logic is almost identical.

In summary: I strongly believe that using a universal app is the best approach to creating an app that runs on on both the iPad and the iPhone.

ryan.scott