Skip to content
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

wrong instance returned by fabMenuController #1016

Closed
ijameelkhan opened this issue Jan 9, 2018 · 7 comments
Closed

wrong instance returned by fabMenuController #1016

ijameelkhan opened this issue Jan 9, 2018 · 7 comments

Comments

@ijameelkhan
Copy link

In my app I have two FAB controllers both are used in total different vertical. But when I try to access fabMenuController it returns wrong instance from different vertical.

Issue comes from how the traversing work. I think it should start from current ViewController and try to find upward. From the code execution that I see it jumps to app delegate root controller and then start to traverse down. Which returns the first instance it find for FabMenuController not the FabMenuController for the vertical I am sitting in ?

@daniel-jonathan
Copy link
Member

It actually goes up and then goes down. I think the issue is that it is only looking for TransitionController types. You can see this in the line below:

v = v?.parent as? TransitionController

If I push a change to development, would you be able to try it? Or can you send me a sample project I can try?

Thank you!

@ijameelkhan
Copy link
Author

yes I can try. Push to dev and I will let you know.
Project it self has grown too much to be shared.

@daniel-jonathan
Copy link
Member

Okay, give this commit a try: cf88010

@ijameelkhan
Copy link
Author

This works - but I am clueless why it works now! Can you explain please.

@daniel-jonathan
Copy link
Member

daniel-jonathan commented Jan 9, 2018

Basically it was skipping over one of your contained view controllers and making it nil, forcing it to search top down. This was happening because it was only looking for TransitionController types, and yours would have been a UIViewController with potentially a different subclass. I will make a release now for this :)

@daniel-jonathan
Copy link
Member

Here is a release for the update: Material 2.13.4. Thank you for sharing :)

@ijameelkhan
Copy link
Author

thank you! Good job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants