是否可以扩展 Reactive 结构,其中基类是我从 UIControl 继承的自定义控件?
当我尝试以下代码时:
extension Reactive where Base: CustomControl {
public var value: ControlProperty<CGFloat> {
return CustomControl.rx.value(
self.base,
getter: { customControl in
customControl.customProperty
},
setter: { customControl, value in
customControl.customProperty = value
}
)
}
}
我收到以下错误:
Instance member "value" cannot be used on type 'Reactive<CustomControl>'
如果您能给我任何解释,我将不胜感激。