0

I know, how to detect whether it iPhone or iPad

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 

I know 2 ways to build universal app:

1) use one controller for 2 xibs (iPhone/iPad)

2) use different viewcontrollers for iPad and iPhone

What's the best way to do that?

Paul T.
  • 4,938
  • 7
  • 45
  • 93

2 Answers2

1

Same View Controllers for iPhone & iPad, but using UIUserInterfaceIdiom as switch case to avoid duplicated view controllers ( with same contents ) created.

You can use different XIBs for iPhone & iPad though.

Raptor
  • 53,206
  • 45
  • 230
  • 366
0

I think use different XIBs is better because use different view controllers means you have to main two almost same code. And on the XIB you can clearly see what you will get using that XIB for iPhone or iPad.

sunkehappy
  • 8,970
  • 5
  • 44
  • 65