Open PierreBrisorgueil opened 5 years ago
Here is code used for is highlighted. Other methods can be done similarly,
var isHighlighted: ControlProperty<Bool> {
let source = RxSwift.Observable<Bool>.create { [weak base] observer in
if let _base = base {
observer.onNext(_base.isHighlighted)
_base.onCellHighlightChanged({ _, row in
observer.onNext(row.isHighlighted)
})
}
return Disposables.create {
observer.onCompleted()
}
}
let bindingObserver = Binder<Bool>(self.base) { row, isHighlighted in
row.isHighlighted = isHighlighted
}
return ControlProperty(values: source, valueSink: bindingObserver)
}
Hello :)
For example, a simple control event to catch cell selection :
=> Argument of '#selector' refers to instance method 'onCellSelection' that is not exposed to Objective-C
some explanation : https://www.hackingwithswift.com/example-code/language/how-to-fix-argument-of-selector-refers-to-instance-method-that-is-not-exposed-to-objective-c
Actually it's difficult to play with eureka and rxSwift :/