Skip to content

Repository files navigation

ARSLineProgress

ARSLineProgress GitHub licenseCarthage 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.

InfiniteSuccessFailNo State Animation
ARSLineProgress InfiniteARSLineProgress SuccessARSLineProgress FailARSLineProgress NoState
OKError
ARSLineProgress OKARSLineProgress Error

Installation

Carthage

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

github "soberman/ARSLineProgress" >= 3.1

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', '~> 3.1'

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.

classfunc show()classfunc showWithPresentCompetionBlock(block:()->Void)classfunc showOnView(view:UIView)classfunc showOnView(view:UIView, completionBlock:()->Void)classfunc hide()classfunc 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.

classfunc showWithProgressObject(progress:NSProgress)classfunc showWithProgressObject(progress:NSProgress, completionBlock:(()->Void)?)classfunc showWithProgressObject(progress:NSProgress, onView:UIView)classfunc showWithProgressObject(progress:NSProgress, onView:UIView, completionBlock:(()->Void)?)
// Updating progress in case you are using on of the methods above:
classfunc updateWithProgress(value:CGFloat)
// initialValue should be from 0 to 100 in these methods
classfunc showWithProgress(initialValue value:CGFloat)classfunc showWithProgress(initialValue value:CGFloat, completionBlock:(()->Void)?)classfunc showWithProgress(initialValue value:CGFloat, onView:UIView)classfunc showWithProgress(initialValue value:CGFloat, onView:UIView, completionBlock:(()->Void)?)

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

staticfunc 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:

classfunc cancelPorgressWithFailAnimation(showFail:Bool)classfunc 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.

About

iOS progress bar, replacement for the default activity indicator.

Topics

Resources

Stars

491 stars

Watchers

15 watching

Forks

Releases

Packages

Used by

Contributors

Languages