How to add new xib files

I have to develop an app with multiple screens. I have automatically generated xib file, but for my other screen I need another xib file. How do I create another xib file?


(Assuming XCode 4)

In the "File -> New File..." menu dialog, there is a subsection called "User Interface."

You will notice in the description of each of the sub-items, it says "An Interface Builder Document." Those are various types of nibs.

If you're creating a new ViewController specifically, you can also choose the "Cocoa Touch" section and select the "UIViewController subclass" item. There is a checkbox in the next page called "With XIB for User Interface." which will create the NIB as well as the associated class files.


For XCode 8 and swift 3:

File -> New File -> iOS -> User Interface -> View

Name it "YourViewController.xib" and saved it.


In XCode 4:


To create a standalone user interface (XIB):

File -> New File -> iOS -> User Interface

Then choose:

  • Application (includes delegate and window)
  • Window
  • View
  • Empty

To create a new UIViewController class with a user interface:

File -> New File -> iOS -> Cocoa Touch -> UIViewController subclass -> Click Next

Then, name the new view controller class and select "With XIB for user interface."