Label and Button that can display activity spinner in place of text to indicate that request is being processed.
Add a label or button and declare its class as For Button: ButtonActivitySpinner For Label: LabelActivitySpinner and Module as ButtonAndLabelActivitySpinner
Then in the code while request is being processed, use
#!
Button.startAnimating()
Label.startAnimating()
to start the activity indicator in the center of button of label.
To Stop Animating, Use
#!
Button.stopanimating
Label.stopanimating
to stop the activity indicator from animating.
You can also change the color of activityIndicator by
#!
Button.activityIndicator.color = UIColor.blueColor()
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
#!
$ gem install cocoa pods
To integrate ButtonAndLableActivitySpinner into your Xcode project using CocoaPods, specify this in your Podfile:
#!
source 'https://reddymk@bitbucket.org/reddymk/buttonandlabelactivityspinner.git'
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'ButtonAndLabelActivitySpinner', '~> 0.1.2'
end
Run the following command:
#!
$ pod install