I have created a parallax type scroll effect (or stretchy header) in my view controller.
I have a uiscrollview, which is anchored to the windows margins. Inside of this I have a view, that is anchored with 0 constant constraints to the scroll view, and set to equal widths. Inside that view is the content. At the top of the content is an image, and this is anchored to the top of the window (safe area guide) using two constraints. First is constant=0 priority=750. Second is constant<=0 priority=1000.
This works.. when i scroll up everything scrolls up. When i scroll down from the top, the image stretches and then bounces back.
Question: I am trying to also implement the navigation bar to hide when user scrolls. I have added this code to the view controller:
override func viewDidAppear(_ animated: Bool) {
navigationController?.hidesBarsOnSwipe = true
}
This works ok when I scroll up (the nav bar fades and animates up until hidden), but when i scroll back down the navigation bar doesn't return. I assume it is hidden somehow by the image that is anchored to the top of the window. But how can I adjust/reattach the navigation bar?
xcode 9 - swift 4