@IBInspectable:无法标记属性

时间:2018-01-25 22:14:18

标签: swift ibinspectable

我一直收到这个错误:

  

属性不能标记为@IBInspectable,因为它的类型不能   在Objective-C中表示

..为什么它的类型需要用Ojective-C表示?有没有一种简单的方法来解决这个问题?

这是发生错误的代码段:

@IBInspectable open weak var dataSource: ColorMatchTabsViewControllerDataSource? {
    didSet {
        _view.scrollMenu.dataSource = dataSource == nil ? nil : self
        _view.tabs.dataSource = dataSource == nil ? nil : self
    }
}

0 个答案:

没有答案