Giter Site home page Giter Site logo

linecode / aaloaders Goto Github PK

View Code? Open in Web Editor NEW

This project forked from engrahsanali/aaloaders

0.0 1.0 0.0 6.22 MB

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.

Home Page: https://cocoapods.org/pods/AALoaders

License: MIT License

Ruby 2.68% Swift 97.32%

aaloaders's Introduction

Table of Contents

#AALoaders

Swift 3.0 Carthage compatible CocoaPods License MIT Build Status License MIT CocoaPods

##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+

Installation

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.

#Getting Started

##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

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.