-
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
TabsController - Missing logic #938
Conversation
…ion view controller. Adds missing required appearance transition calls for the source & destination view controllers.
@seubseub please can you test this PR as you mentioned you also had the issue where by the child view controllers do not belong to parent. |
I must be missing something here. All seems to work and I updated Motion. Thanks for double checking this. |
@DanielDahan my advice is add all this logic to your tab view controllers: override open func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
print("\(self) viewWillAppear - Parent: \(self.parent)")
}
override open func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
print("\(self) viewDidAppear - Parent: \(self.parent)")
}
override open func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
print("\(self) viewWillDisappear - Parent: \(self.parent)")
}
override open func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
print("\(self) viewDidDisappear - Parent: \(self.parent)")
} |
I’ll double check :) |
without this PR notice how the view lifecycle calls are performed way too many times & has no parent:
vs. with this PR:
|
Without the To overcome this perhaps the |
What version are you using? |
@DanielDahan or perhaps rather |
That's your commit. What version are you testing that Material fails on? |
Well, I put the logic in Motion, which is the actual transition library. So I need to see the issue, I am testing your lifecycle functions in the sample. |
@DanielDahan which is good. but as the screenshot demonstrated Perhaps consider using:
As this prevents this said behaviour & |
…` & is no longer responsible for performing appearance transitions.
☝🏾 yup that last commit combined with latest version of Motion (CosmicMind/Motion@b9a2576) produces the desired behaviour |
Please try this commit 68308ad |
I found an issue with that last commit, but please still do try it. The issue is in other TransitionControllers. |
I will need to look this through some more, but your suggestion is on the right track. I have to confirm this doesn't break other controllers and that all cases are handled. Thank you! I will get back to this tonight or tomorrow morning :) |
@DanielDahan yeah nice. that's commit is spot on. works exactly as expected. Thanks! Important to note a release update to Motion is required, to include the appearance transition updates ( CosmicMind/Motion@b9a2576 ) |
Only thing I can spot with those changes is the appearance transitions are not being called on the initial root view controller. Perhaps the following needs to take place when setting the initial root view controller (without transition)
or perhaps |
Please find a comprehensive update in Material 2.12.7. Thank you for working on this with me :) |
As outlined in #935 and provided fix in #936.
Here is a PR again which provides the appropriate logic for adding the destination view controller to the child view controller stack & calls the appropriate appearance transitions in the correct order.