-
Notifications
You must be signed in to change notification settings - Fork 160
Fix uinavigationcontrollerdelegate forwarding for real #312
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
base: main
Are you sure you want to change the base?
Fix uinavigationcontrollerdelegate forwarding for real #312
Conversation
68b8583
to
da98da1
Compare
Looks like that failure in da98da1 was a false positive. This PR is good for merging then. Edit: pushed final change to remove random .orig file that appeared. |
91d4943
to
6883e9b
Compare
reportIssue( | ||
""" | ||
UINavigationControllerDelegate object is being set after | ||
NavigationStackController's viewDidLoad() has been called, | ||
so delegate functions will not be observed. Set your delegate | ||
in your subclass's initializer to fix this issue | ||
""" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this an issue that plagues UIKit in general? Do we really need to report this issue in our library? People should just know that they always need to set their delegates right when the controller is initialized, and never do it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't know that 🤣 I was thinking that this could prevent others in the future from creating a ticket in swift-navigation repo. But, I'm happy with whatever decision you make given that I now know what the problem was.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I don't think we need to report issues that help people use UIKit correctly. If you revert this we will merge and release the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! I'll do it later tonight when I'm in front of the keyboard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
6883e9b
to
e9a6375
Compare
There was lots of discussion in #311 on how to address the issue with
PathDelegate
being registered as NavigationStackController'ssuper.delegate
earlier than expected, so here's a PR that takes @tgrapperon 's changes, adds a purple run-time warning letting users know to set their delegate in theinit
, and an update to the test that addresses this issue.