-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TransitionController - Initial RootViewController view lifecycle not occuring #940
Comments
This is due to |
There needs to be a feature where by lifecycle functions are performed when updating root view controller directly. self.rootViewController = UIViewController() // View lifecycle not called
self.transition(to: UIViewController(), completion: nil) // View lifecycle called |
I see what you are describing. I have an idea of how to make it work correctly. I will give it a try after another task I am working on. |
Not a huge fan of it, but passing the transition logic on as follows, resolved it for me: open class TransitionController: UIViewController {
open override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.rootViewController.beginAppearanceTransition(true, animated: animated)
}
open override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.rootViewController.endAppearanceTransition()
}
open override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.rootViewController.beginAppearanceTransition(false, animated: animated)
}
open override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
self.rootViewController.endAppearanceTransition()
}
|
Well I was thinking that in the |
yeah sounds fine. trusting it's toggled at the right occasion |
I actually like your solution better as it is clear as to what is happening. With a hidden flag, which I am not a fan of, does not demonstrate clarity when looking through the code. I am going to test how your solution works. |
This is the corresponding commit that will be in the next release 5e8497d, thank you! |
Please find this fix in Material 2.12.8 :) |
The initial root view controller view lifecycle functions are not being called on initial load of root view controller. All subsequent lifecycle functions are working as expect.
The text was updated successfully, but these errors were encountered: