Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b38ff7f706 | |||
| 73e9f07d00 | |||
| 761621d049 | |||
| b479603ff2 | |||
| 74a409692f |
@@ -9,7 +9,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "MMMaterialDesignSpinner"
|
||||
s.version = "0.1.0"
|
||||
s.version = "0.2.0"
|
||||
s.summary = "An iOS activity spinner modeled after Google's Material Design spinner"
|
||||
s.description = <<-DESC
|
||||
I love Google's new indeterminate spinner in the [Material Design guidelines](http://www.google.com/design/spec/components/progress-activity.html#progress-activity-types-of-indicators), and I hadn't found a recreation of it for iOS yet, so I created it using CoreGraphics and CoreAnimation, which makes it super lightweight, smooth, and scalable to large sizes.
|
||||
|
||||
@@ -8,14 +8,40 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
/**
|
||||
* A control similar to iOS' UIActivityIndicatorView modeled after Google's Material Design Activity spinner.
|
||||
*/
|
||||
@interface MMMaterialDesignSpinner : UIView
|
||||
|
||||
/** Sets the line width of the spinner's circle. */
|
||||
@property (nonatomic) CGFloat lineWidth;
|
||||
|
||||
/** Sets whether the view is hidden when not animating. */
|
||||
@property (nonatomic) BOOL hidesWhenStopped;
|
||||
|
||||
/** Specifies the timing function to use for the control's animation. Defaults to kCAMediaTimingFunctionEaseInEaseOut */
|
||||
@property (nonatomic, strong) CAMediaTimingFunction *timingFunction;
|
||||
|
||||
/** Property indicating whether the view is currently animating. */
|
||||
@property (nonatomic, readonly) BOOL isAnimating;
|
||||
|
||||
/**
|
||||
* Convenience function for starting & stopping animation with a boolean variable instead of explicit
|
||||
* method calls.
|
||||
*
|
||||
* @param animate true to start animating, false to stop animating.
|
||||
@note This method simply calls the startAnimating or stopAnimating methods based on the value of the animate parameter.
|
||||
*/
|
||||
- (void)setAnimating:(BOOL)animate;
|
||||
|
||||
/**
|
||||
* Starts animation of the spinner.
|
||||
*/
|
||||
- (void)startAnimating;
|
||||
|
||||
/**
|
||||
* Stops animation of the spinnner.
|
||||
*/
|
||||
- (void)stopAnimating;
|
||||
|
||||
@end
|
||||
|
||||
@@ -69,6 +69,10 @@ static NSString *kMMRingRotationAnimationKey = @"mmmaterialdesignspinner.rotatio
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setAnimating:(BOOL)animate {
|
||||
(animate ? [self startAnimating] : [self stopAnimating]);
|
||||
}
|
||||
|
||||
- (void)startAnimating {
|
||||
if (self.isAnimating)
|
||||
return;
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
[](http://cocoadocs.org/docsets/MMMaterialDesignSpinner)
|
||||
[](http://cocoadocs.org/docsets/MMMaterialDesignSpinner)
|
||||
|
||||

|
||||
|
||||
## Usage
|
||||
|
||||
To run the example project, clone the repo, and run `pod install` from the Example directory first.
|
||||
|
||||
Reference in New Issue
Block a user