Code Monkey home page Code Monkey logo

arslineprogress's Introduction

ARSLineProgress

ARSLineProgress GitHub license Carthage compatible

iOS progress bar as a replacement for iOS activity indicator. This progress HUD will add some nice style touch to your application. Moreover, you can customize this progress loader through customization structure.

Infinite Success Fail No State Animation
ARSLineProgress Infinite ARSLineProgress Success ARSLineProgress Fail ARSLineProgress NoState

Installation

Carthage

To install with Carthage, simply specify this in your Cartfile:

github "soberman/ARSLineProgress" >= 1.0

In case you don't have Carthage installed yet, you could do this with Homebrew:

$ brew update
$ brew install carthage

I would also advise to refer to this section of the Carthage description, for when you're building for iOS, tvOS or WatchOS

CocoaPods

To install with CocoaPods, copy and paste this in your Podfile file:

use_frameworks!
platform :ios, '8.0'
pod 'ARSLineProgress', '~> 1.0'

Rookie way

You can always do it the old-fashioned way - just drag the source file into your projects and you are good to go.

Usage

ARSLineProgress makes it easy to use it - you have ARSLineProgress class, that offers you a wide range of class methods to show progress loader.

Showing

You can show progress indicator in two modes: infinite and progress. Infinite one will be shown until you hide it.

class func show()
class func showWithPresentCompetionBlock(block: () -> Void)
class func showOnView(view: UIView)
class func showOnView(view: UIView, completionBlock: () -> Void)

class func hide()
class func hideWithCompletionBlock(block: () -> Void)

Progress indicator will be shown until the NSProgress object has the fractionCompleted value 1.0 or in case you have passed raw value - 100.0.

class func showWithProgressObject(progress: NSProgress)
class func showWithProgressObject(progress: NSProgress, completionBlock: (() -> Void)?)
class func showWithProgressObject(progress: NSProgress, onView: UIView)
class func showWithProgressObject(progress: NSProgress, onView: UIView, completionBlock: (() -> Void)?)

// Updating progress in case you are using on of the methods above:
class func updateWithProgress(value: CGFloat)

// initialValue should be from 0 to 100 in these methods
class func showWithProgress(initialValue value: CGFloat)
class func showWithProgress(initialValue value: CGFloat, completionBlock: (() -> Void)?)
class func showWithProgress(initialValue value: CGFloat, onView: UIView)
class func showWithProgress(initialValue value: CGFloat, onView: UIView, completionBlock: (() -> Void)?)

You are able to show just the 'success' checkmark or fail with these methods:

static func showSuccess()
static func showFail()
Hiding

Hiding progressHUD can be similar to what you have done so far with the infinite loader, or you could use these dedicated methods:

class func cancelPorgressWithFailAnimation(showFail: Bool)
class func cancelPorgressWithFailAnimation(showFail: Bool, completionBlock: (() -> Void)?)

Customization

You can customize progressHUD through the ARSLineProgressConfiguration structure, that offers you a wide range of customization. Any changes are going to be visible only if you have set them before showing preloader, otherwise they are going to be visible during your next show of preloader.

Once you have changed your mind and you want to restore ARSLineProgressConfiguration to its default parameters - use static func restoreDefaults() method.

Other

ARSLineProgress automatically responds to orientation changes, so it always going to be centered on the screen.

License

ARSLineProgress is released under the MIT license. See LICENSE for details.

arslineprogress's People

Contributors

soberman avatar

Stargazers

MohsinAli avatar

Watchers

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