Andrii Kuzminskyi
Andrii Kuzminskyi

Reputation: 171

Incorrect module for custom class in Interface Builder

When I use some custom UI class in Interface Builder from module/frameworks everything work perfect. But if I write extension for this class in my project and set custom class(in Interface Builder), Interface Builder will set module of custom class is my project. And when I try to use this custom class in code, Xcode say:

"Unknown class _TtC9*modulename*18*MyCustomLabel* in Interface Builder file."

An example:

Xcode write that it is TTTAttributedLabel.

 extension TTTAttributedLabel{ }

And Xcode write warning message and say that our label is UILabel.

Is it a Interface Builder bug or maybe I must write something before extension for modules?

Info: swift, xcode6.3-7.3

Upvotes: 4

Views: 1302

Answers (1)

Steven
Steven

Reputation: 439

I am seeing the same problem, I seem to have found a workaround though.

In order to avoid this bug, you have to provide the full name of the class including the module name when creating the extension. So it becomes:

extension TTTAttributedLabel. TTTAttributedLabel { }

Upvotes: 2

Related Questions