How do I add iPad to an existing iOS app?

I have an iPhone app that is completed and has been available in the app store for quite some time.


What is the best way to also offer it for iPad? Because of the size differanc in the screens the Nib files will need to be differant between the iPhone version and the iPad version. I am just wondering should I make a dupe of the app and convert the Nib files, or is there a way for the app to use the correct Nib for the device it's on?


Thanks

Replies

Without knowing the details surrounding your particular app (which iOS version support, any localization, etc.), I'd suggest to make a new app, say w/Xcode's SingleView template, choosing the Universal option that supports both iPhone & iPad. Study that for the basics, then dupe yours and go from there.


I'd also suggest you move to Storyboards vs. nib/xib.


You could just dupe that app, then set it's configuration to Universal, then tweak/tweak/tweak, but a DIY effort may be more learning than you'll need unless you have more than one app you want to convert.


Good luck.

When you selected "universal" there used to be an automatic creation of two Xib files, MainWindow.xib and MainWindow-iPad.xib, that allowed you to create two separate code streams but I think that is now gone with all of Storyboard 'convenient' features. You can use Apple's 'best practices' approach with Storyboards and the like and, if it works for you, that's the "easiest" approach.


Unfortunately for me, it never works and I can't control it so I gave up on all that Storyboard stuff. Instead I set 'Device' to 'Universal' in the Target under General. Then I detect the value of self.view.bounds.size.width and self.view.bounds.size.height and adjust everything based on that. You can also use the UIDevice class to determine which device is running - but width and height is all you need to define the layout.