Commit 8269aa16 by Daniel Dahan

development: issue-644: Fived issue where where Switch.isOn and…

development: issue-644: Fived issue where where Switch.isOn and Switch.switchState were not updating correctly.
parent e67a843a
...@@ -186,7 +186,7 @@ open class Switch: UIControl { ...@@ -186,7 +186,7 @@ open class Switch: UIControl {
return .on == internalSwitchState return .on == internalSwitchState
} }
set(value) { set(value) {
updateSwitchState(state: .on, animated: true, isTriggeredByUserInteraction: false) updateSwitchState(state: value ? .on : .off, animated: true, isTriggeredByUserInteraction: false)
} }
} }
...@@ -196,7 +196,7 @@ open class Switch: UIControl { ...@@ -196,7 +196,7 @@ open class Switch: UIControl {
return internalSwitchState return internalSwitchState
} }
set(value) { set(value) {
updateSwitchState(state: .on, animated: true, isTriggeredByUserInteraction: false) updateSwitchState(state: value, animated: true, isTriggeredByUserInteraction: false)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment