RXSwift switch action iOS

 Solution:

            cell.mySwitch

                .rx

                .controlEvent(.valueChanged)

                .withLatestFrom(cell.mySwitch.rx.value)

                .subscribe(onNext : { bool in

                    // this is the value of mySwitch

                    let isON = cell.mySwitch.isOn

                })

                .disposed(by: cell.disposebag)

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift