Unknown class <MyClass> in Interface Builder file in Swift

I am programming Apple's ToDoList Objective-C tutorial, but try to do it in Swift. ( Tutorial )

Now that I'm ready, when I launch the application, I get an error:

Unknown AddToDoItemViewController class in Interface Builder file in Swift.

In this thread, someone solved a, since I think there is a similar problem with [MyClass class] in Objective-C. Is there a similar way to do this in Swift?

+8
ios swift interface-builder
source share
3 answers

A similar line in swift would be AddToDoItemViewController.self . All that really matters is that you call your view controller from the quick code, so the linker knows that it includes this file.

+1
source share

I found that many of my Swift controllers had a new module parameter that was set to None Failure

So, to fix this, just set the class to another, and then set it back. It gave me this

enter image description here

+32
source share

I came across this situation when I made a mistake and used a different expression in the @OBJC statement than my declared class name.

+1
source share

All Articles