TruMan1 TruMan1 - 1 year ago 471
Swift Question

How to bind UISwitch to UIButton enable in RxSwift?

I have a

that needs to be selected in order to continue onto the next form screen. So I would like to bind the
selected to the
enabled. I just can't get this sample going.

Here's what I'm trying but doesn't compile:

let termsValidation = termsSwitch


What's the correct way to get this to work in RxSwift and RxCocoa?

Answer Source

You should use rx_value rather than rx_selected.