To run the example project, clone the repo, and run pod install
from the Example directory first.
SpinnerButton is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SpinnerButton'
- iOS 9.0+
Start loading animation:
[self.button startAnimating];
Stop loading animation:
[self.button stopAnimating];
Stroke line width of the animated border (default: 5):
self.button.strokeLineWidth = 2;
Define a corner radius (default: 5):
self.button.cornerRadius = 5;
Define a color of the animated stroke:
[self.button setStrokeColor:UIColor.redColor];
Define mulitple colors to make gradient in the animated stroke:
NSArray *colors = [[NSArray alloc] initWithObjects:UIColor.blueColor, UIColor.redColor, UIColor.orangeColor, nil];
[self.button setStrokeColors:colors];
Time interval of animation duration:
self.button.timeInterval = 0.5;
Max Kalik, [email protected]
SpinnerButton is available under the MIT license. See the LICENSE file for more info.