Merge pull request #122 from TouchInstinct/fix/changeRoot
Change root controller fixed
This commit is contained in:
commit
0706e36860
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -32,10 +32,17 @@ public extension UIWindow {
|
|||
/// Method changes root controller in window.
|
||||
///
|
||||
/// - Parameter controller: New root controller.
|
||||
func changeRootController(controller: UIViewController) {
|
||||
animateRootViewControllerChanging(controller: controller)
|
||||
/// - Parameter animated: Indicates whether to use animation or not.
|
||||
func changeRootController(controller: UIViewController, animated: Bool = true) {
|
||||
if animated {
|
||||
animateRootViewControllerChanging(controller: controller)
|
||||
}
|
||||
|
||||
let previousRoot = rootViewController
|
||||
previousRoot?.dismiss(animated: false) {
|
||||
previousRoot?.view.removeFromSuperview()
|
||||
}
|
||||
|
||||
rootViewController?.dismiss(animated: false, completion: nil)
|
||||
rootViewController = controller
|
||||
makeKeyAndVisible()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue