diff --git a/CHANGELOG.md b/CHANGELOG.md index 275eab44..2e0463d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +### 0.7.2 + +- **Fixed**: Change root controller for window + ### 0.7.1 - **Add**: Extension for comparing optional arrays (`[T]?`) with `Equatable` elements. - **Add**: `additionalHttpHeaders` static field in `ConfigurableNetworkService` protocol. diff --git a/LeadKit.podspec b/LeadKit.podspec index 7874d965..79bec383 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LeadKit" - s.version = "0.7.1" + s.version = "0.7.2" s.summary = "iOS framework with a bunch of tools for rapid development" s.homepage = "https://github.com/TouchInstinct/LeadKit" s.license = "Apache License, Version 2.0" diff --git a/Sources/Extensions/UIWindow/UIWindow+Extensions.swift b/Sources/Extensions/UIWindow/UIWindow+Extensions.swift index 22514fc5..3bf79ee9 100644 --- a/Sources/Extensions/UIWindow/UIWindow+Extensions.swift +++ b/Sources/Extensions/UIWindow/UIWindow+Extensions.swift @@ -35,7 +35,11 @@ public extension UIWindow { func changeRootController(controller: UIViewController) { animateRootViewControllerChanging(controller: controller) - rootViewController?.dismiss(animated: false, completion: nil) + let previousRoot = rootViewController + previousRoot?.dismiss(animated: false) { + previousRoot?.view.removeFromSuperview() + } + rootViewController = controller makeKeyAndVisible() }