Git Product home page Git Product logo

jdfpeekaboo's Introduction

JDFPeekaboo

Version License Platform

JDFPeekaboo is a simple class that hides the navigation bar when you scroll down, and shows it again when you scroll back up. It can actually be any UIView that it hides, and it will also hide a view at the bottom of the screen as well, if you like.

Here's a little demo of it in use:

It's very easy to use. Simply add a property for it:

@property (nonatomic, strong) JDFPeekabooCoordinator *scrollCoordinator;

Then, set it up (say, in -viewDidLoad):

self.scrollCoordinator = [[JDFPeekabooCoordinator alloc] init];
self.scrollCoordinator.scrollView = self.scrollView;
self.scrollCoordinator.topView = self.navigationController.navigationBar;
self.scrollCoordinator.bottomView = self.navigationController.toolbar;

Sometimes, you may want to temporarily disable JDFPeekaboo, for example when you push another view controller onto your navigation controller. Some convenience methods are provided for disabling JDFPeekaboo (and re-enabling it). See the documentation for more info.

Documentation

You can find the docs here (on CocoaDocs).

You can also find a bit more info on my blog post

FAQ

Q: Why are there black spaces at the top/bottom of the screen, like this:

A: This happens if your table view doesn't extend behind the navigationBar/tabBar. You can fix this by setting your UIViewController/UITableViewController's edgesForExtendedLayout (to UIRectEdgeTop/UIRectEdgeBottom/UIRectEdgeAll/whatever is appropriate), or by doing the equivalent in interface builder.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

JDFPeekaboo is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "JDFPeekaboo"

Author

Joe Fryer, [email protected]

Twitter - JoeFryer88

License

JDFPeekaboo is available under the MIT license. See the LICENSE file for more info.

Releases

0.2

  • Fixed some bugs (improved landscape support).
  • Improved the showing/hiding behaviour (thanks @gbhrdt).
  • Fixed some CocoaPods stuff (thanks @GorkaMM).
  • Added some convenience methods for enabling/disabling JDFPeekaboo.

0.1

Initial Release

jdfpeekaboo's People

Contributors

joefryer avatar gorkamm avatar gbhrdt avatar

Watchers

王小王 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.