Jevon Çøö Jevon Çøö - 1 year ago 93
iOS Question

NavigationBar Hides and Shows Depending on User Scroll direction IOS SWIFT

This idea has been driving em crazy as I haven't been able to find a suitable solution despite the multiple threads its created. so basically I want to be able to hide the

upon swipe, but I also want to be able to call it back upon an up swipe (like facebook ) and I want to do it without having to use any code from GitHub.

here's my idea of how to do such:

Get the direction in which a user is swiping on a screen (or in my case a
with a
inside) and if the direction is down, the
disappears and if the direction is up, the
slides back down. The only issue is that I don't see any clear way for doing this from a
. can someone help me with a step by step of how such can be implemented?

Answer Source

Set navigation controller property hidesBarsOnSwipe to true

override func viewDidAppear(animated: Bool) {

    navigationController?.hidesBarsOnSwipe = true

You can also you also use third party library

You can read how to hide in apple developer documentation

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download