I want to prevent my UIButtons from emitting RX tap events until some control stream indicates that it is ready. I want buttons to be disabled again if the control stream reverts back to not ready. Control sequence is a ReplaySubject and always has value
I've tried skipUntil, but that's a one shot operation - once the control sequence emits, it cannot go back to disabled state - all button presses will go through, ignoring the control sequence
How can I restrict a UIButton from sending tap events unless some other stream has a certain value?
let enableButtons = configStatusInputSequence
.filter { (configured, ready) -> Bool in
return configured && ready
}
for button in controlButtons{
button.rx.tap
.skipUntil(enableButtons)
.bind(to: commandOutputSequence)
.disposed(by: bag)
}