Skip to content

Commit 4051056

Browse files
author
Daniel Dahan
committed
issue-1245: Fixed issue where completion block was not executed when calling Switch.toggle
1 parent 815097b commit 4051056

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 3.1.6
2+
- [issue-1245](https://github.com/CosmicMind/Material/issues/1245): Fixed issue where completion block was not executed when calling Switch.toggle.
3+
14
## 3.1.5
25

36
- [pr-1248](https://github.com/CosmicMind/Material/pull/1248): Exposed Obj-C methods for NavigationDrawerController.

Material.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Material'
3-
s.version = '3.1.5'
3+
s.version = '3.1.6'
44
s.swift_version = '5.0'
55
s.license = 'BSD-3-Clause'
66
s.summary = 'A UI/UX framework for creating beautiful applications.'

Sources/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>3.1.5</string>
18+
<string>3.1.6</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

Sources/iOS/Switch/Switch.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,12 @@ fileprivate extension Switch {
414414

415415
if animated {
416416
animateToState(state: state) { [weak self, isTriggeredByUserInteraction = isTriggeredByUserInteraction] _ in
417-
guard isTriggeredByUserInteraction else {
417+
guard let s = self else {
418418
return
419419
}
420420

421-
guard let s = self else {
421+
guard isTriggeredByUserInteraction else {
422+
completion?(s)
422423
return
423424
}
424425

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

433434
guard isTriggeredByUserInteraction else {
435+
completion?(self)
434436
return
435437
}
436438

0 commit comments

Comments
 (0)