From 250b3a3bf9af1cd714c793a0c3d138d3d5192057 Mon Sep 17 00:00:00 2001 From: Will McGinty Date: Wed, 8 May 2019 10:13:03 -0500 Subject: [PATCH 1/2] Ensure completion is called at all times in container --- Sources/UtiliKit/Container/ContainerViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/UtiliKit/Container/ContainerViewController.swift b/Sources/UtiliKit/Container/ContainerViewController.swift index c32aa98..5f9e436 100644 --- a/Sources/UtiliKit/Container/ContainerViewController.swift +++ b/Sources/UtiliKit/Container/ContainerViewController.swift @@ -78,7 +78,7 @@ private extension ContainerViewController { func transition(to destination: UIViewController, completion: ((Bool) -> Void)? = nil) { //Ensure that the view is loaded, we're not already transitioning and the transition will result in a move - guard isViewLoaded && !isTransitioning, visibleController != destination else { return } + guard isViewLoaded && !isTransitioning, visibleController != destination else { completion?(true); return } guard let source = visibleController else { //If we do not already have a visible controller (first launch), skip the animator and contain the child @@ -90,7 +90,7 @@ private extension ContainerViewController { return } - guard delegate?.containerViewController(self, shouldTransitionFrom: source, to: destination) ?? true else { return } + guard delegate?.containerViewController(self, shouldTransitionFrom: source, to: destination) ?? true else { completion?(false); return } //Inform the delegate transitioning is set to begin delegate?.containerViewController(self, didBeginTransitioningFrom: source, to: destination) From 868dc841d55e8781e58851e55c5eda6ce4a0a9c8 Mon Sep 17 00:00:00 2001 From: Will McGinty Date: Wed, 8 May 2019 10:34:18 -0500 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e59b699..99087f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,9 @@ ##### Bug Fixes -* None. +* Fix a bug where completion wasn't always called when transitioning. +[Will McGinty](https://github.com/willmcginty) +[#57](https://github.com/BottleRocketStudios/iOS-UtiliKit/pull/57) ## 1.4.0 (2019-04-30)