Skip to content

A subclass-able ViewController to allow your Navigation Bar to scroll along with your scroll view

License

Notifications You must be signed in to change notification settings

chetem/CHScrollingNavBarViewController

Repository files navigation

CHScrollingNavBarViewController

alt text          alt text

Getting Started:

To use this class, simply subclass it in replace of your UIViewController.

NOTE: You must set a navigation bar tint color prior to use.

-Inside ViewDidLoad, call -initNavBarScrollingForScrollView: and pass in your scrollable view (i.e. UIScrollView, UITableView, UICollectionView)

-You can then set the animationDuration property (optional), which controls the duration for which an animation will complete if the navigation bar did not fully scroll up/down.

-Then inside your scrollView Delegate methods, call the following passing through the 'scrollView' and 'decelerate' parameters:

  • -startNavBarScrolling: in -scrollViewWillBeginDragging:
  • -followScrollViewScrolling: in -scrollViewDidScroll:
  • -endScrollViewScrolling:willDecelerate: in -scrollViewDidEndDragging:willDecelerate:

That's it! Your navigation bar should scroll along with your scrollable view. See the example for clarification.

About

A subclass-able ViewController to allow your Navigation Bar to scroll along with your scroll view

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published