Coder Social home page Coder Social logo

busynavigationbar's Introduction

BusyNavigationBar

Version License Platform

A UINavigationBar extension to show loading effects above navigation bar's background.

Screenshot

Stripes

gray_stripe.gif blue_stripe2.gif

Bars

gray_bar.gif green_bar.gif

Your custom layer

gray_bird.gif

Usage

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

use_frameworks!
pod "BusyNavigationBar"

Or add the following lines to your Cartfile:

github "gmertk/BusyNavigationBar" "master"

After installation is done, you can use the new methods of your navigation bar; start(_ options: BusyNavigationBarOptions) and stop().

Properties

var options = BusyNavigationBarOptions()

/**
    Animation type

    - Stripes: Sliding stripes as seen in Periscope app.
    - Bars: Bars going up and down like a wave.
    - CustomLayer(() -> CALayer): Your layer to be inserted in navigation bar. In this case, properties other than `transparentMaskEnabled` and `alpha` will not be used. 
*/
options.animationType = .Stripes

/// Color of the shapes. Defaults to gray.
options.color = UIColor.grayColor()

/// Alpha of the animation layer. Remember that there is also an additional (constant) gradient mask over the animation layer. Defaults to 0.5.
options.alpha = 0.5

/// Width of the bar. Defaults to 20.
options.barWidth = 20

/// Gap between bars. Defaults to 30.
options.gapWidth = 30

/// Speed of the animation. 1 corresponds to 0.5 sec. Defaults to 1.
options.speed = 1

/// Flag for enabling the transparent masking layer over the animation layer.
options.transparentMaskEnabled = true


// Start animation
self.navigationController?.navigationBar.start(options)

// Stop animation
self.navigationController?.navigationBar.stop()

Author

Günay Mert Karadoğan, [email protected]

License

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

More

There is a nice tutorial about Periscope's pull-to-refresh control by @bitwaker.

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.