I'm using AMScrollingNavbar to hide my Navigation Bar when scrolling. However, I'm stuck at at the part where it mentioned:
Make sure to use a subclass of ScrollingNavigationController for your UINavigationController. Either set the class of your UINavigationController in your storyboard, or create programmatically a ScrollingNavigationController instance in your code.
I've tried many ways to do it.
I tried to add
ScrollingNavigationController
in myUITableViewController
of the controller that I want the navigation bar to collapse. However it throws an errorUse of undeclared type ScrollingNavigationController
.I tried to add an instance of
ScrollingNavigationController
inside myUITableViewController
, but same error ofUse of undeclared type ScrollingNavigationController
.
Tried searching online for solution, but can't find any. Appreciate your help!
EDIT:
class PostScreenNC: UINavigationController, ScrollingNavigationController {
override func viewDidLoad() {
super.viewDidLoad()
if let navigationController = navigationController as? ScrollingNavigationController {
navigationController.followScrollView(tableView, delay: 50.0)
}
// Do any additional setup after loading the view.
}
}