#AALoaders
##Description
AALoaders is a lightweight, easy-to-use and powerful progress view loaders framework, written in Swift. It uses simple native elements for progress loading with customisations and allow to use without creating instance.
##Demonstration
It includes four type of loading views as follows:
To run the example project, clone the repo, and run pod install
from the Example directory first.
##Requirements
- iOS 8.0+
- Xcode 8.0+
- Swift 3+
AALoaders
can be installed using CocoaPods, Carthage, or manually.
##CocoaPods
AALoaders
is available through CocoaPods. To install CocoaPods, run:
$ gem install cocoapods
Then create a Podfile with the following contents:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target '<Your Target Name>' do
pod 'AALoaders'
end
Finally, run the following command to install it:
$ pod install
##Carthage
To install Carthage, run (using Homebrew):
$ brew update
$ brew install carthage
Then add the following line to your Cartfile:
github "EngrAhsanAli/AALoaders" "master"
Then import the library in all files where you use it:
import AALoaders
##Manual Installation
If you prefer not to use either of the above mentioned dependency managers, you can integrate AALoaders
into your project manually by adding the files contained in the Classes folder to your project.
##AANavigationLoader
AANavigationLoader
is basically UIProgressView
bar loading in UINavigationController
with options for customization.
AANavigationOptions
can be configured using following types:
AANavigationOptions | Types | Description |
---|---|---|
maxProgress |
Float |
Max progress value allowed for animation |
barHeight |
CGFloat |
UIProgressView bar height (1.0 to 5.0) |
barProgressColor |
UIColor |
UIProgressView bar progress color |
barBackgroundColor |
UIColor |
UIProgressView bar tracking color |
progressStep |
Float |
Progress animation step (0.05 to 0.0025) |
Usage:
let options = AANavigationOptions()
// Configure options
//
//
//
// Show loader with options
self.navigationController?.aa_showLoader(options)
// Show loader without options
self.navigationController?.aa_showLoader()
// Cancel loader
self.navigationController?.aa_hideLoader(true)
// Complete loader
self.navigationController?.aa_hideLoader(false)
##AAButtonLoader
AAButtonLoader
is basically UIActivityIndicatorView
loading in UIButton
with options for customization.
AAButtonOptions
can be configured using following types:
AAButtonOptions | Types | Description |
---|---|---|
color |
UIColor? |
Activity indicator color |
position |
LoaderPosition? |
Activity indicator position in UIButton |
LoaderPosition
has following types:
- left
- right
- before
- after
- middle
Usage:
let options = AAButtonOptions()
// Configure options
//
//
//
// Toggle loader with options
self.button.aa_toggleLoader(options)
// Toggle loader without options
self.button.aa_toggleLoader()
##AAImageLoader
AAImageLoader
is basically UIActivityIndicatorView
loading with downloading from given HTTP URL in UIImageView
with options for customization.
AAImageOptions
can be configured using following types:
AAImageOptions | Types | Description |
---|---|---|
color |
UIColor |
Activity indicator color |
Usage:
let options = AAImageOptions()
// Configure options
//
//
//
// Set image with options
self.imageView.aa_setImage(string: <URL_HERE>, withOptions: options)
// Set image without options
self.imageView.aa_setImage(string: <URL_HERE>)
##AADialogLoader
AADialogLoader
is basically UIActivityIndicatorView
loading with title and message in UIAlertController
and options for customization.
AADialogOptions
can be configured using following types:
AADialogOptions | Types | Description |
---|---|---|
title |
String? |
Title string |
message |
String? |
Message string |
titleAttributes |
Dictionary<String, Any>? |
Title attributes |
messageAttributes |
Dictionary<String, Any>? |
Message attributes |
loaderColor |
UIColor? |
Activity indicator color |
cancelColor |
UIColor? |
Cancel button color |
cornerRadius |
CGFloat? |
Corner radius |
borderWidth |
CGFloat? |
Border width |
borderColor |
UIColor? |
Border color |
shadowColor |
UIColor? |
Shadow color |
blurEffect |
UIBlurEffectStyle? |
UIBlurEffectStyle style |
backgroundColor |
UIColor? |
Background color |
Usage:
let options = AADialogOptions()
// Configure options
//
//
//
// Show dialog with options
self.aa_showLoader(deadline: dismissTime, options: options, withCancel: "Cancel")
// Show dialog without options
self.aa_showLoader(deadline: dismissTime)
// Show dialog without deadline
self.aa_showLoader()
#Contributions & License
AALoaders
is available under the MIT license. See the LICENSE file for more info.
Pull requests are welcome! The best contributions will consist of substitutions or configurations for classes/methods known to block the main thread during a typical app lifecycle.
I would love to know if you are using AALoaders
in your app, send an email to Engr. Ahsan Ali