From 003d10571612717bf564e95645989b104b7f5391 Mon Sep 17 00:00:00 2001 From: Andre Nguyen Date: Thu, 20 Dec 2018 15:04:13 +0100 Subject: [PATCH 1/2] Update M13CheckboxStrokeController.swift change unowned references to weak (results in crashes in some instances) --- Sources/Managers/M13CheckboxStrokeController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Managers/M13CheckboxStrokeController.swift b/Sources/Managers/M13CheckboxStrokeController.swift index df04067..ef990a0 100644 --- a/Sources/Managers/M13CheckboxStrokeController.swift +++ b/Sources/Managers/M13CheckboxStrokeController.swift @@ -105,7 +105,7 @@ internal class M13CheckboxStrokeController: M13CheckboxController { let quickOpacityAnimation = animationGenerator.quickOpacityAnimation(true) CATransaction.begin() - CATransaction.setCompletionBlock({ [unowned self] () -> Void in + CATransaction.setCompletionBlock({ [weak self] () -> Void in self.resetLayersForState(self.state) completion?() }) @@ -141,7 +141,7 @@ internal class M13CheckboxStrokeController: M13CheckboxController { let morphAnimation = animationGenerator.morphAnimation(fromPath, toPath: toPath) CATransaction.begin() - CATransaction.setCompletionBlock({ [unowned self] () -> Void in + CATransaction.setCompletionBlock({ [weak self] () -> Void in self.resetLayersForState(self.state) completion?() }) From 4c721fb5175342d6e09fade657f6786f05258731 Mon Sep 17 00:00:00 2001 From: Andre Nguyen Date: Thu, 20 Dec 2018 15:17:19 +0100 Subject: [PATCH 2/2] fixed weak self reference --- Sources/Managers/M13CheckboxStrokeController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Managers/M13CheckboxStrokeController.swift b/Sources/Managers/M13CheckboxStrokeController.swift index ef990a0..c9e465c 100644 --- a/Sources/Managers/M13CheckboxStrokeController.swift +++ b/Sources/Managers/M13CheckboxStrokeController.swift @@ -106,7 +106,7 @@ internal class M13CheckboxStrokeController: M13CheckboxController { CATransaction.begin() CATransaction.setCompletionBlock({ [weak self] () -> Void in - self.resetLayersForState(self.state) + self?.resetLayersForState(self?.state) completion?() }) @@ -142,7 +142,7 @@ internal class M13CheckboxStrokeController: M13CheckboxController { CATransaction.begin() CATransaction.setCompletionBlock({ [weak self] () -> Void in - self.resetLayersForState(self.state) + self?.resetLayersForState(self?.state) completion?() })