更新时间:2023-11-17 13:10:04
目前,我认为Interface Builder只识别Objective-C的名称类。您仍然可以使Interface Builder找到一个带有@objc关键字的嵌套类:
At this time, I think that Interface Builder only recognizes the names of Objective-C classes. You can still make Interface Builder find a nested class with the @objc keyword:
class SuperView: UIView {
@objc(SVNestedView) class NestedView: UIImageView {
}
}
然后,在Interface Builder中,指定该视图是SVNestedView类。由于Objective-C没有命名空间,你仍然需要为每个嵌套类选择唯一的名称,但至少Swift方面是正确的命名空间。
Then, in Interface Builder, specify that th view is of class SVNestedView. Since Objective-C isn't namespaced, you still need to pick unique names for each nested class, but at least the Swift side is properly namespaced.