Search code examples
iphoneiosxcodeipadinterface-builder

Converting an iPhone app to an iPad app in XCode 4


I had created an iPhone app long time back. Now I want to kind of convert the same into an iPad app (the code would more or less remain the same, I only want to redesign the xib for iPad size).

Now I am using XCode 4 and after opening the app, I changed the devices to iPad. But my .xib are still showing iPhone size. It created an iPad folder (just like Classes/Resources/Products...).

Also to add, the app now opens an iPad simulator, but let's say I have a UIWebView which just stretches to iPhone size (as in IB) and not the complete iPad size...

How and where do I redesign the xib for iPad ? What are the updates to be made when we just change the devices from iPhone to iPad ? Also I guess an iPhone app would work on iPad (using 2x), but the reverse is not true.


Solution

  • You should look into creating a Universal app which basically has shared code and libraries for the iPhone and iPad but different view layers (views or XIBs).

    In that model you have different interfaces for both which you should. The paradigms are different - in iPhone you have small real estate so you have navigators that drill in and pop out. In iPad, you have more real estate so you have master/detail splitter views with pop-over controls. As you pointed out, even the web views are different sizes at a minimum.

    If you start fresh you can create a universal app and get a feel for how it's laid out. File, new project, iOS, pick app type, next. For device family select Universal.

    If you are converting, there's some resources out there. Here's some:

    http://useyourloaf.com/blog/2010/4/7/converting-to-a-universal-app-part-i.html

    How to convert iPhone app to universal in xcode4, if I previously converted, but deleted MainWindow-iPad?

    Convert simple iPhone app to Universal app