Search code examples
iphoneiosipadxcode4

how to load different xibs in iphone and ipad?


I wanna at certain point of the program to load different xib for iphone and for ipad but wanna to reuse most part of the code. how can I achieve this ?


Solution

  • Append ~ipad or ~iphone to the end of the file name. So SomeViewController~ipad.xib or SomeViewController~iphone.xib for instance.

    See iOS Supports Device-Specific Resources.