Coder Social home page Coder Social logo

yippeeapp / gtscrollnavigationbar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from luugiathuy/gtscrollnavigationbar

0.0 3.0 0.0 687 KB

A scrollable UINavigationBar that follows a UIScrollView

License: BSD 3-Clause "New" or "Revised" License

Ruby 0.27% Objective-C 96.85% C++ 0.09% C 0.36% Shell 2.43%

gtscrollnavigationbar's Introduction

GTScrollNavigationBar

CocoaPods Version Build Status Coverage Status

A lightweight scrollable UINavigationBar that follows a UIScrollView. This project was inspired by the navigation bar functionality seen in the Chrome, Facebook and Instagram iOS apps.

=======

GTScrollNavigationBar Screenshot 1ย GTScrollNavigationBar Screenshot 2

Installation

CocoaPods

Add pod GTScrollNavigationBar to your Podfile.

Manually

Add the GTScrollNavigationBar folder to your project. GTScrollNavigationBar uses ARC, so if you have a project that doesn't use ARC, add the -fobjc-arc compiler flag to the GTScrollNavigationBar files.

Usage

Set up the navigation controller to use GTScrollNavigationBar:

#import "GTScrollNavigationBar.h"

self.navController = [[UINavigationController alloc] initWithNavigationBarClass:[GTScrollNavigationBar class]
                                                                   toolbarClass:nil];
[self.navController setViewControllers:@[self.mainViewController] animated:NO];

In your view controller which has a UIScrollView, e.g. UITableViewController, set the UIScrollView object to the GTScrollNavigationBar in viewWillAppear: or viewDidAppear: by:

self.navigationController.scrollNavigationBar.scrollView = self.tableView;

To unfollow the scrollView, simply set scrollView property to nil

self.navigationController.scrollNavigationBar.scrollView = nil;

Implement scrollViewDidScrollToTop: in the view controller to reset the navigation bar's position

- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView
{
    [self.navigationController.scrollNavigationBar resetToDefaultPositionWithAnimation:NO];
}

Contact

@luugiathuy

gtscrollnavigationbar's People

Contributors

luugiathuy avatar jeffphp avatar igrandav avatar ccraigc avatar jvenegas avatar zaully avatar

Watchers

Chew Chit Siang avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.