Skip to content

Commit

Permalink
issue-1245: Fixed issue where completion block was not executed when …
Browse files Browse the repository at this point in the history
…calling Switch.toggle
  • Loading branch information
Daniel Dahan committed Jun 27, 2019
1 parent 815097b commit 4051056
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.1.6
- [issue-1245](https://github.com/CosmicMind/Material/issues/1245): Fixed issue where completion block was not executed when calling Switch.toggle.

## 3.1.5

- [pr-1248](https://github.com/CosmicMind/Material/pull/1248): Exposed Obj-C methods for NavigationDrawerController.
Expand Down
2 changes: 1 addition & 1 deletion Material.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '3.1.5'
s.version = '3.1.6'
s.swift_version = '5.0'
s.license = 'BSD-3-Clause'
s.summary = 'A UI/UX framework for creating beautiful applications.'
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.1.5</string>
<string>3.1.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
6 changes: 4 additions & 2 deletions Sources/iOS/Switch/Switch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,12 @@ fileprivate extension Switch {

if animated {
animateToState(state: state) { [weak self, isTriggeredByUserInteraction = isTriggeredByUserInteraction] _ in
guard isTriggeredByUserInteraction else {
guard let s = self else {
return
}

guard let s = self else {
guard isTriggeredByUserInteraction else {
completion?(s)
return
}

Expand All @@ -431,6 +432,7 @@ fileprivate extension Switch {
styleForState(state: state)

guard isTriggeredByUserInteraction else {
completion?(self)
return
}

Expand Down

0 comments on commit 4051056

Please sign in to comment.