LuckyLuke
LuckyLuke

Reputation: 49097

How to make a universal app

I have a iPhone app I want to convert to an universal app so it can run on iPad. I have tried to find information about how to do it, but I don't find anything that answers my question. I have upgraded the iphone target in xcode to ipad. Then I get a new MainWindow-iPad.xib.

But I have many viewcontrollers and I have made those with code, not xib's. Do I need to have a if-clause in the loadView method that loads different viewcontroller depending on if the user has a iPhone or iPad?

Upvotes: 0

Views: 357

Answers (2)

Stephen Darlington
Stephen Darlington

Reputation: 52565

It kind of depends on how you've implemented your loadView methods and how you want your iPad version to differ from your iPhone app.

If you just want your app to use the full screen, you can mostly just check the size of the screen and size your views appropriately and use the autoresizing mask to deal with things when you change orientations.

There are a few gotcha's with this approach, though. For example, modal views can work differently (not taking up the whole screen) and, obviously, the keyboard is a different size.

If you want to use completely different views for your iPad app then, yes, you'll quite possibly have if statements that tell it to use completely different view controllers.

Upvotes: 1

dks1725
dks1725

Reputation: 1631

Yes you have to create all xib's for iPad and then you have to write if-clause for Ipad xib to be loaded.

Upvotes: 0

Related Questions