如何解决此问题,安装xcode 9后,请向我展示以下内容
“属性不能标记为@IBInspectable,因为它的类型不能在目标-c中表示”
/// The mode of the gradient. The default is `.Linear`.
@IBInspectable open var mode: Mode = .linear {
didSet {
setNeedsDisplay()
}
}
/// The direction of the gradient. Only valid for the `Mode.Linear` mode. The default is `.Vertical`.
@IBInspectable open var direction: Direction = .vertical {
didSet {
setNeedsDisplay()
}
}发布于 2017-10-03 04:39:30
您需要为枚举添加@objc:
@objc public enum Mode: Int {
...
}
@objc public enum Direction: Int {
...
}您确实需要Int基类型,如果它是@objc样式,就不能是“空白”类型。
https://stackoverflow.com/questions/46380521
复制相似问题