0

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.

  1. I tried to add ScrollingNavigationController in my UITableViewController of the controller that I want the navigation bar to collapse. However it throws an error Use of undeclared type ScrollingNavigationController.

  2. I tried to add an instance of ScrollingNavigationController inside my UITableViewController, but same error of Use 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.
  }
}
jo3birdtalk
  • 616
  • 5
  • 20

0 Answers0