Closed aehlke closed 6 years ago
I copied the source into my project so that I could more easily debug, and I see that the issue is that the self.scrollableView == nil
check fails in followScrollView
on the 2nd time I open the VC, despite it being a new instance of the VC and despite having previously called stopFollowingScrollView
. I'll dig in further later.
Hey @aehlke were you able to reproduce the issue in the demo project by any chance?
@andreamazz my current line of investigation is to step through the code in my own project, now that I imported AMScrollingNavbar's source and can see which variable is unexpectedly non-nil and causing the wrong code path to execute. I'll let you know when I can narrow down what's responsible.
Well, simple:
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
print(navigationController)
[...]
}
prints nil
. Odd, but must be something I'm doing wrong rather than the library. But perhaps a different recommendation is needed in the documentation. I'm still investigating but I see reports that this is possible under normal circumstances.
My solution for now is private weak var weakNavigationController: UINavigationController?
Describe the bug I've implemented the library according to the readme. It works great the first time I navigate to the VC where I use this library. When I navigate back and forth again, I can see that
navigationController.scrollingEnabled
is true, but the navbar does not hide when I scroll anymore.I have the following:
I also confirmed the VC deinitializes between navigating away and back to a new instance of it.
To Reproduce Steps to reproduce the behavior: iOS 12. I will try to create an example project.
Expected behavior I expect the navbar to hide again when I scroll after re-opening a VC.
Anything obvious jump out as a possible cause for this? I'm a bit lost about what to investigate at this point.