52

I've created new Cocoa Touch File. Named it SwipingViewController. enter image description here

Then try to add Custom Class to ViewController.

And when I run the app I receive an error

2015-10-09 10:53:25.054 ParseStarterProject[5369:389307] Unknown class SwipingViewController in Interface Builder file.

Unknown class SwipingViewController in Interface Builder file

Related: Xcode 6 Strange Bug: Unknown class in Interface Builder file

Here is my projects files

Cœur
  • 37,241
  • 25
  • 195
  • 267
Alex Belke
  • 2,143
  • 5
  • 17
  • 24

8 Answers8

141

In storyboard below the Custom Class field the module is set to None. Change that to your app module or just remove and enter class again, it should set to default like this:

bummi
  • 27,123
  • 14
  • 62
  • 101
Nakul
  • 1,452
  • 1
  • 10
  • 6
16

For me the problem was that the class was not part of the Target Membership. Just add the class to the target, and you should see it back on the interface builder.

Target Membership

Rodrigo Gonzalez
  • 723
  • 7
  • 15
  • I faced same issue in XCode 9.3 and i did exactly the same way it works , even by changing module inside xml file din't work , so this answer should work in latest xcode and old one too. Nice catch. – Shobhakar Tiwari May 24 '18 at 09:07
10

Still seeing this problem with XCode 8.2.1, but I am able to fix the problem by modify these in the storyboard xml file:

  1. Delete customModuleProvider="target" in the viewController tag:

    - <viewController ... customModule="Flights" customModuleProvider="target" sceneMemberID="viewController">
    + <viewController ... customModule="Flights" sceneMemberID="viewController">
    
  2. Delete customModule="Flights" customModuleProvider="target" in the widget tag (in my case, a label tag):

    - <label ... translatesAutoresizingMaskIntoConstraints="NO" id="PzF-6K-Hpi" customClass="YZLabel" customModule="Flights" customModuleProvider="target">
    + <label ... translatesAutoresizingMaskIntoConstraints="NO" id="PzF-6K-Hpi" customClass="YZLabel">
    

I find that step 1 is very important too to resolve the crash/warning and cannot be skipped.

Yuchen
  • 30,852
  • 26
  • 164
  • 234
3

I resolved a similar issue by adding '-ObjC' to 'Other linker flags' in the 'Build Settings' of my project.

sagnitude
  • 31
  • 1
  • 2
1

i had a similar issue as well. I had a ViewController with a TableView in it, and the tableView's custom class was called 'ViewController'. I just deleted the custom class for the tableView and the error went away.

kev
  • 21
  • 5
  • Thanks. I solved it using your method. I accidentally added "MyCustomViewController" to the custom class for both ViewController and TableView inside. – user3204765 Jul 27 '17 at 12:56
0

I resolved this issue by applying view controller initialise. View-controller basic declaration of view did load method and class implementation in *.swift class shows in storyboard.

RaviM
  • 62
  • 14
0

I solved it by manually writing the module name in the storyboard, under the class name. In my case it was the same name as the class, but it may differ.

Mijail
  • 186
  • 10
0

For me: for table view cell in 'Indentity Inspector' unchecked 'Inherit Module From Target' and cleaned the project. It solved the problem and project run successfully

Kiryl Ivanou
  • 1,015
  • 2
  • 12
  • 22