New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UISwitch.on does not produce element #690

NicolasRiviere opened this Issue May 19, 2016 · 2 comments


None yet
2 participants
Copy link

NicolasRiviere commented May 19, 2016

Hello !

When i click on my switch, the next element (bool) is produced and visible in my debugger output.
But if i set programmatically the state of my switch, no element is produced and nothing is logged.

mySwitch.rx_value.subscribeNext { (next) in

mySwitch.on = true //Nothing visible in my debugger

The next element "true" should be emitted, no ? Am i missing something ?

Thank you for your help !


This comment has been minimized.

Copy link

tarunon commented May 20, 2016

Hi @NicolasRiviere ,
ControlProperty would not observe programatic changes.
You could bind with Variable and change value using Variable.

let switchValue = Variable(false)
(mySwitch.rx_value <-> switchValue)
  .subscribeNext { (next) in

switchValue.value = true 

Please refer to these discussions, I think these would useful for you. (#551, #471)


This comment has been minimized.

Copy link

NicolasRiviere commented May 20, 2016

Thank you very much for your help @tarunon !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment