Commit 1523b5d4 by Daniel Dahan

master: issue-644: Fixed issue where where Switch.isOn and Switch.switchState…

master: issue-644: Fixed issue where where Switch.isOn and Switch.switchState were not updating correctly.
parent 5a50bc7a
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Material' s.name = 'Material'
s.version = '2.4.3' s.version = '2.4.4'
s.license = 'BSD-3-Clause' s.license = 'BSD-3-Clause'
s.summary = 'Material is an animation and graphics framework for Google\'s Material Design in Swift.' s.summary = 'Material is an animation and graphics framework for Google\'s Material Design in Swift.'
s.homepage = 'http://materialswift.com' s.homepage = 'http://materialswift.com'
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.4.3</string> <string>2.4.4</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
......
...@@ -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,9 +196,7 @@ open class Switch: UIControl { ...@@ -196,9 +196,7 @@ open class Switch: UIControl {
return internalSwitchState return internalSwitchState
} }
set(value) { set(value) {
if value != internalSwitchState { updateSwitchState(state: value, animated: true, isTriggeredByUserInteraction: false)
internalSwitchState = value
}
} }
} }
......
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