I have already read this thread Hide NavigationBar when scrolling tableView in CollectionView?
but I still can't get what I want. I know that there is a pod that can do this, but I try to avoid using pod.
I want to hide the navigation bar when the user scroll down the table view, and I want the navigation bar back when the user scroll up back to the top. like in the "today" bar in the App Store.
I have tried to use
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.hidesBarsOnSwipe = true
}
it can hide the navigation bar when I scroll down the table view, but when I scroll up back to the top, the navigation bar still disappear.
you can see here is the .gif file that the I can't unhide the navigation bar back : http://g.recordit.co/zIW2DkCc6j.gif
here is the contraint of my table view
what should I do ? or maybe you have other code ? please share :)