Giter VIP home page Giter VIP logo

iosloadingbuttonview's Introduction

iOSLoadingButtonView

this is a small library to show loading and indicator in UIButton, colors are customizable

todo

  • animation style like appstore download button
  • make swift version

TOP_LINE

installation cocoapods

just add this line into your podfile

  pod 'loadingButtonOBJC'

or simply copy the source into your project, take a look at example project for more info

Configs

  //you can set these in interface builder or code
   
  // AnimationType in Interfacebuilder
  Int setAnimationType;
  (default)  NONE = 0,
    TOP_LINE = 1,
    INDICATOR = 2,
    BACKGROUND_HIGHLIGHTER = 3,
    CIRCLE_AND_TICK = 4,
    ALL = 5

  //or in code - default none
  LoadingType animationType;
  
  //loading color, set this in code or IB - default black
  UIColor setLoadingColor;
  
  //loading color, set this in code or IB - default black
  UIColor setFilledBackgroundColor;
  
  // indicator view color (white or gray) - default white
  BOOL setIndicatorViewDarkStyle;
  

start and stop loading, update percent

// just import this
#import "LBVLoadingButtonView.h"

//start
[button startLoading:BACKGROUND_HIGHLIGHTER];

//stop
[button endLoading];

//update filling background 
[button fillTheButtonWith:percent];

//update circle stroke in circle mode
[button fillTheCircleStrokeLoadingWith:percent];

//(e.g)
[NSTimer scheduledTimerWithTimeInterval:1 repeats:true block:^(NSTimer * _Nonnull timer) {
        percent += 10;
       [button fillTheCircleStrokeLoadingWith:percent];
       [button fillTheButtonWith:percent];
 }];

also you can use it as a class for your buttons in interface builder, and change those options from interface builder

set class

ALL

change attributes

ALL

iosloadingbuttonview's People

Contributors

valentinjahanmanesh avatar

Watchers

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