Search code examples
iphoneiosxcodeipadios-universal-app

Universal iPhone/iPad application


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?


Solution

  • 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.