switch change action in RXSwift iOS

 Solution:

            cell.pSwitch

                .rx

                .controlEvent(.valueChanged)

                .withLatestFrom(cell.pSwitch.rx.value)

                .subscribe(onNext : { bool in

                    self.view?.endEditing(true)

                    // this is the value of mySwitch

print("switch value here", cell.pSwitch.isOn)

                })

                .disposed(by: cell.disposebag)

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift