Coder Social home page Coder Social logo

jinjorge / bpblockactivityindicator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ppth0608/bpblockactivityindicator

1.0 3.0 0.0 27 KB

A simple and awesome loading Activity Indicator(with block moving animation) for your iOS app.

License: MIT License

Ruby 5.40% Swift 94.60%

bpblockactivityindicator's Introduction

BPBlockActivityIndicator

BPBlockActivityIndicator is a clean and easy-to-use Activity Indicator meant to display the progress of an ongoing task on iOS.

Demo

Requirements

  • Deployment Target - iOS 8.0
  • Swift Version - Swift 3.2

Installation

CocoaPods

BPBlockActivityIndicator is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "BPBlockActivityIndicator"

Carthage

simply add the following line to your Cartfile:

github "ppth0608/BPBlockActivityIndicator"

Manual

Copy the folder Source/ to your project

Usage

Using BPBlockActivityIndicator isn't difficult at all. There are two actual ways of implementing it in your project:

  • Storyboard setup
  • Manual setup

Storyboard Setup

First, you're about to add 1 UIViews to your Storyboard and setup custom classes (You can set custom classes in Identity Inspector) as it shown in the picture below

2017-07-17 12 51 06

and, add Outlet in to your code

@IBOutlet weak var blockIndicator: BPBlockActivityIndicator!

Menual setup

if for some reason you'd like to setup BPBlockActivityIndicator manually you have to do the following step

var blockIndicatorindicator: BPBlockActivityIndicator!

override func viewDidLoad() {
    super.viewDidLoad()

    // initialize BPBlockActivityIndicator programmingly        
    blockIndicatorindicator = BPBlockActivityIndicator(frame: CGRect(x: 0, y: 0, width: 40, height: 40))
    view.addSubview(blockIndicatorindicator)
}

Animate & Stop

You can easily animate and stop animation

@IBAction func startAnimate(_ sender: Any) {
    blockIndicator.animate()
}

@IBAction func stopAnimate(_ sender: Any) {
    blockIndicator.stop()
}

Customize

if you want to setup animation speed or color of blocks(if usung storyboard) you can set property in Identity Inspector as it shown in the picture below

2017-07-17 12 51 51

or (if using code) , you can call methods as it shown in the code below

blockIndicatorindicator = BPBlockActivityIndicator(frame: CGRect(x: 30, y: 30, width: 40, height: 40))
            .movementSpeed(0.2)
            .blockColor(.cyan)
view.addSubview(blockIndicatorindicator)

Default setting is shown in below

  • Animation Speed : 0.6
  • Color of blocks : Blue

Author

Ben.Park, [email protected]

Designed By

Suna.Shin, [email protected]

Contribute

always welcome :) please, pull request for BPBlockActivityIndicator

License

BPBlockActivityIndicator is available under the MIT license. See the LICENSE file for more info.

bpblockactivityindicator's People

Contributors

ppth0608 avatar

Stargazers

 avatar

Watchers

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