Skip to content

this is a small library about showing loading and indicator in UIButton

License

Notifications You must be signed in to change notification settings

carabina/iOSLoadingButtonView

 
 

Repository files navigation

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

About

this is a small library about showing loading and indicator in UIButton

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 95.8%
  • Ruby 4.2%