Skip to content

Commit

Permalink
Adds README
Browse files Browse the repository at this point in the history
  • Loading branch information
soberman committed Jan 25, 2016
1 parent c9e5b82 commit 6898007
Showing 1 changed file with 60 additions and 8 deletions.
68 changes: 60 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,77 @@
# ARSPopover
Universal popover for iPhone and iPad that you can use in your projects. No custom drawing, no custom elements - everything is purely native.
![ARSLineProgress](http://git.arsenkin.com/ARSLineProgress/ARSLineProgress.png)

| iPhone | iPad |
| ---------------------------- | ------------------------ |
| ![ARSPopover-iPhone][iPhone] | ![ARSPopover-iPad][iPad] |
# ARSLineProgress
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.

[iPhone]: http://git.arsenkin.com/ARSPopover-iPhone.gif
[iPad]: http://git.arsenkin.com/ARSPopover-iPad.gif
| Infinite | Success | Fail | No State Animation |
| ------------------------------------- | ----------------------------------- | ----------------------------- | -------------------------------- |
| ![ARSLineProgress Infinite][Infinite] | ![ARSLineProgress Success][Success] | ![ARSLineProgress Fail][Fail] | ![ARSLineProgress NoState][NoState] |

[Infinite]: http://git.arsenkin.com/ARSLineProgress/ARSLineProgress_infinite.gif
[Success]: http://git.arsenkin.com/ARSLineProgress/ARSLineProgress_progress_with_success.gif
[Fail]: http://git.arsenkin.com/ARSLineProgress/ARSLineProgress_progress_with_fail.gif
[NoState]: http://git.arsenkin.com/ARSLineProgress/ARSLineProgress_without_final_animation.gif

## Installation

### CocoaPods
To install with [CocoaPods](http://cocoapods.org/), copy and paste this in your *Podfile* file:

platform :ios, '8.3'
platform :ios, '8.0'
pod 'ARSLineProgress', '~> 1.0'

### Non-CocoaPods way
You can always to do the old 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 offer you a wide range of class methods to show progress loader.

###### Showing
You can show progress indicator in two modes: infinite and progress.
Infinite progress will be shown until you hide it.
``` Swift
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`.

``` Swift
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)?)
```

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

``` Swift
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 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](http://opensource.org/licenses/MIT). See LICENSE for details.

0 comments on commit 6898007

Please sign in to comment.