Coder Social home page Coder Social logo

haiwei-lee / uinavigationitem-loading Goto Github PK

View Code? Open in Web Editor NEW

This project forked from antongaenko/uinavigationitem-loading

0.0 1.0 0.0 169 KB

Simple category to show a loading status in a navigation bar in place of left/right items or title.

License: MIT License

Objective-C 93.39% Ruby 6.61%

uinavigationitem-loading's Introduction

UINavigationItem-Loading

License

Easy way to show loading/uploading status for user in a navigation bar.

Introduction

With needing of this pattern again I decide to make this category. So here it is, with just few methods and fully customized in color.

Demo

NavigationBarLoaderDemo

or build it yourself

pod try UINavigationItem+Loading

Usage

Just import this category in your view controller (which is embed in UINavigationController).

#import <UINavigationItem+Loading.h>

When you need to show loading status just call

[self.navigationItem startAnimatingAt:ANNavBarLoaderPositionCenter];

Left, right and center position are available. So you can also use ANNavBarLoaderPositionLeft or ANNavBarLoaderPositionRight for loader position. When you need to stop it nothing can be more simple as

[self.navigationItem stopAnimating];

That’s all!

To customize color for loader just set it with appearance proxy like this

[UIActivityIndicatorView appearanceWhenContainedIn:[UINavigationBar class], nil].color = [UIColor blackColor];

Installation

Add the following to your CocoaPods Podfile

pod 'UINavigationItem+Loading', '~> 1.1'

or clone it as a git submodule,

or just copy files

License

All this code is available under the MIT license.

Contact

Follow me on Twitter or Github

More sources

You can be also interested to simplify your work with iOS keyboard UIViewController-KeyboardAnimation

uinavigationitem-loading's People

Contributors

antongaenko 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.