ZMScrollableNavigationBar 1.0.3

ZMScrollableNavigationBar 1.0.3

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release May 2015

Maintained by Zedenem.



  • By
  • Zouhair Mahieddine

A UINavigationController subclass that allows the UINavigationBar to scroll with the content (iOS 8 only)

Click on the image to see a video preview:

Screenshot

Installation

Usage

Using a UIScrollView in your UIViewController, you can simply hook up the scroll to the UINavigationBar animation. Here are the two methods you need to implement:

- (void)viewDidLayoutSubviews {
  [super viewDidLayoutSubviews];
  self.navigationController.topOffset = -self.scrollView.contentOffset.y;
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
  self.navigationController.topOffset = -scrollView.contentOffset.y;
}

ZMScrollableNavigationBar also provides a method to reset the navigation bar's offset (for example when another view is pushed). Just call:

[self.navigationController resetTopOffset];

TODO

  • Handle Rotation
  • Show UINavigationBar again when user quickly swipes up