Converting iPhone xib to iPad xib?

Assume you've the SDK with Xcode 3,

  1. Open IB.
  2. Open the XIB.
  3. File -> Create iPad version using autoresizing masks.

I was able to narrow it down to a few things, so here are the steps that worked for me:

1) Make a copy of the iPhone xib file and add it to your project

2) Right click the file (in xcode) and Open As > Source Code

3) The 2nd line should look like:

<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">

Replace with:

<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="7.10">

4) Search for "IBCocoaTouchFramework" and Replace all occurrences with "IBIPadFramework"

5) Save the file and Open As > Interface Builder - iOS

The file might still look like a regular iPhone xib, but for me, once I changed the Status Bar to "Black" in the Attributes inspector the rest of the xib just kind of "snapped" into an iPad xib


XCode4:

In xcode 4 we can't do that for a single xib,but we can create respective ipad versions all at once.

Before configuring your project to ipad,when it is configured only for iphone, right click on target and click on duplicate.

Now select "duplicate and transition to ipad".A new target and new set of xibs are created.It should reduce some work.

Hope it helps.


In Xcode 5 you should just:

Find:

<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4510" systemVersion="12F37" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">

Replace by:

<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="4510" systemVersion="12F37" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">

Note we are just adding .iPad to the type and targetRuntime properties.

After opening just select a new Size to adjust. Example: iPad Full Screen.