Skip to content

A collection of loading buttons and their stylings written in Swift.

License

Notifications You must be signed in to change notification settings

mohsinalimat/loading-buttons-ios

 
 

Repository files navigation

Loading Buttons

A collection of loading buttons and their styling written in Swift.

Generic badge Generic badge Generic badge Generic badge

You may see the following Medium article for detailed explanation of creating loading buttons.

Key Features

  • The example gives you 8 choices of loading indicators with the loading button.
  • The IndicatorProtocol clearly defines the functions and properties. You can refer to it and customize your own.
  • The LoadingButton class is made to be open, from which you can easily inherit and create your own.

Requirements

  • Swift 5.0
  • iOS 11.0+

Installation

LoadingButtons project is available via CocoaPods. To install it, simply add the following line to your Podfile:

$ pod 'MHLoadingButton'

If you don't use CocoaPods, you can download the entire project then import all the source files and use them in your project.

Usage

Declaration

// You may set the frame to zero if you use AutoLayout to handle the frame. 
// Otherwise, specify the frame in initializer.
btnLoading = LoadingButton(frame: .zero, text: "Button", textColor: .black, bgColor: .white)

System Default

btnLoading.indicator = UIActivityIndicatorView()

System Default

Material Design

btnLoading.indicator = MaterialLoadingIndicator(color: .gray)

Material Design

Ball Pulse

btnLoading.indicator = BallPulseSyncIndicator(color: .gray)

Ball Pulse

Ball Pulse Sync

btnLoading.indicator = BallSpinFadeIndicator(color: .gray)

Ball Pulse Sync

Ball Spin

btnLoading.indicator = LineScalePulseIndicator(color: .gray)

Ball Spin

Line Scale

btnLoading.indicator = LineScaleIndicator(color: .gray)

Line Scale

Line Scale Pulse

btnLoading.indicator = BallPulseIndicator(color: .gray)

Line Scale Pulse

Ball Beat

btnLoading.indicator = BallBeatIndicator(color: .gray)

Ball Beat

Credits

About

A collection of loading buttons and their stylings written in Swift.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 89.7%
  • Ruby 9.5%
  • Objective-C 0.8%