From 4051056de09f5ce1eb14b10737b6329a9e401a50 Mon Sep 17 00:00:00 2001 From: Daniel Dahan Date: Thu, 27 Jun 2019 13:44:23 -0600 Subject: [PATCH] issue-1245: Fixed issue where completion block was not executed when calling Switch.toggle --- CHANGELOG.md | 3 +++ Material.podspec | 2 +- Sources/Info.plist | 2 +- Sources/iOS/Switch/Switch.swift | 6 ++++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59ab998a5..bc7f00358 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/Material.podspec b/Material.podspec index f60efa7d0..21093c0eb 100755 --- a/Material.podspec +++ b/Material.podspec @@ -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.' diff --git a/Sources/Info.plist b/Sources/Info.plist index 31a4ce3d1..addf7a925 100644 --- a/Sources/Info.plist +++ b/Sources/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.1.5 + 3.1.6 CFBundleSignature ???? CFBundleVersion diff --git a/Sources/iOS/Switch/Switch.swift b/Sources/iOS/Switch/Switch.swift index cf034cc64..8488848a7 100644 --- a/Sources/iOS/Switch/Switch.swift +++ b/Sources/iOS/Switch/Switch.swift @@ -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 } @@ -431,6 +432,7 @@ fileprivate extension Switch { styleForState(state: state) guard isTriggeredByUserInteraction else { + completion?(self) return }