2

I am using currently Xcode 4.3.2. I have developed a tiny application and specified 'Universal' for the target, and I see two .xib files are generated. One is for iPhone, and the other is for iPad. I have designed minimum UI with iPhone .xib, and now would like to use the same application for iPad also.

1) Do I have to again design iPad.xib, as I designed iPhone.xib?. 2) As for as I understand 'Universal' means for both?. If so, then why are two different .xib files provided?

How do I make my application run on iPad as well, with minimal changes?

Thunder Rabbit
  • 5,405
  • 8
  • 44
  • 82
Whoami
  • 13,930
  • 19
  • 84
  • 140
  • Future readers: http://stackoverflow.com/questions/10029332/create-single-xib-for-universal-app-in-interface-builder-ios has more/better options IMHO. – eselk Sep 11 '14 at 17:24

3 Answers3

2

It's two separate files, because UI for iPad and UI for iPhone are quite different. Probably it would look strange if you just scale up your iPhone UI for iPad. In the iPad xib you make use of the iPad's larger display.

Niklas Berglund
  • 3,563
  • 4
  • 32
  • 32
1

The easiest way is to copy and paste the items from your iphone .xib into your ipad .xib and the resize the items to be the appropriate sizes for ipad.

You can create a .xib from scratch for ipad and then select it under Targets > "Application name" > Summary > iPad Deployment Info, Main storyboard.

But yes, while you can use the same .xib and just use it in x2 mode, it's better to make another interface, and it only takes a few minutes usually.

Steven Marlowe
  • 230
  • 2
  • 16
0

universal means that the bits of the application can be executed on the two architectures (iPhone and iPad), It is not related to nib files, you have 2 options:

1) use the same iphone nib file and than tap (2x) on the bottom left of the screen when iPad simulator is launched, which is not an appropriate way.

2) the best way is to do two separate nib files, each for a certain device.