21

The checkbox to create a .xib file in Xcode 6 seems to be disabled. I can not find any way to enable it again. Does anybody know if this is possible?

4 Answers 4

63

Make sure you didn't accidentally select the OS X Cocoa Class file type instead of iOS Cocoa Touch Class.

Incorrect:

Screenshot of creating an OS X Cocoa Class

Correct:

Screenshot of creating an iOS Cocoa Touch Class

Sign up to request clarification or add additional context in comments.

1 Comment

great bit, that didn't stop me from accidentally creating it without the xib though
8

FYI, you can create xib file by follow.

enter image description here

Comments

4

Creating xib files in xcode 6 is,

First of all create empty project as, Go to-> File > New >Project, Then select IOS >Other > Empty then Next After that creating a xib file as, Go to->File >New> File then IOS > Cocoa Touch Class and then NEXT Then select Viewcontroller and check for the "Also create XIB file" Then Next

This will create a empty project as well as xib file.

1 Comment

I think, you didn't select the subclass as UIViewController on that page. Try this one and then check for the XIB file. Thank you!
3

I had encountered this problem. Below is fix for this :

  1. Right click on files present in Project Navigator section.
  2. Select New File.

    OR

    Select File from list of tab present in Xcode

    Select New -> File

    OR

    Simply press cmd+N

  3. Choose template for your new file as iOS not OS X, tvOS or watchOS.

Screenshot 1

  1. Select Cocoa Touch Class and then press Next

  2. Enter Class name and select subclass of it.

  3. Checkmark Also create XIB file.

  4. Select device type and Language and then click Next

  5. Click on Create and make sure that Targets is selected.

    Screenshot 2

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.