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?

Zigii Wong
  • 7,766
  • 8
  • 51
  • 79
csciXAV_12
  • 309
  • 1
  • 5
  • 13

4 Answers4

64

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

Mike Akers
  • 12,039
  • 14
  • 58
  • 71
8

FYI, you can create xib file by follow.

enter image description here

Zigii Wong
  • 7,766
  • 8
  • 51
  • 79
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.

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

Jayprakash Dubey
  • 35,723
  • 18
  • 170
  • 177