Skip to content

Commit

Permalink
Added startLoaderWithColor:
Browse files Browse the repository at this point in the history
  • Loading branch information
bguidolim committed Feb 24, 2015
1 parent 39cabf4 commit e2eaba7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions Pod/Classes/RJCircularLoaderView.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
- (void)reveal;

@property (nonatomic) CGFloat progress;
@property (strong, nonatomic) UIColor *tintColor;

@end
7 changes: 6 additions & 1 deletion Pod/Classes/RJCircularLoaderView.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ - (instancetype)initWithFrame:(CGRect)frame
_circlePathLayer.frame = self.bounds;
_circlePathLayer.lineWidth = 2;
_circlePathLayer.fillColor = [UIColor clearColor].CGColor;
_circlePathLayer.strokeColor = [UIColor redColor].CGColor;
_circlePathLayer.strokeStart = 0;
_circlePathLayer.strokeEnd = _progress;
[self.layer addSublayer:_circlePathLayer];
Expand Down Expand Up @@ -112,6 +111,12 @@ - (void)setProgress:(CGFloat)progress
self.circlePathLayer.strokeEnd = _progress;
}

- (void)setTintColor:(UIColor *)tintColor
{
_tintColor = tintColor;
self.circlePathLayer.strokeColor = _tintColor.CGColor;
}

- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
{
self.superview.layer.mask = nil;
Expand Down
1 change: 1 addition & 0 deletions Pod/Classes/UIImageView+RJLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

- (void)updateImageDownloadProgress:(CGFloat)progress;
- (void)startLoader;
- (void)startLoaderWithColor:(UIColor *)color;
- (void)reveal;

@end
5 changes: 5 additions & 0 deletions Pod/Classes/UIImageView+RJLoader.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ - (void)updateImageDownloadProgress:(CGFloat)progress

- (void)startLoader
{
[self startLoaderWithColor:[UIColor redColor]];
}

- (void)startLoaderWithColor:(UIColor *)color {
RJCircularLoaderView *loaderView = self.rj_circularLoaderView;
loaderView.frame = self.bounds;
loaderView.tintColor = color;
[self addSubview:loaderView];
loaderView.progress = 0;
}
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Rounak Jain.
Follow me on Twitter [@r0unak](https://twitter.com/r0unak)
##Contributors
[@bguidolim](http://twitter.com/bguidolim)
## License
RJImageLoader is available under the MIT license. See the LICENSE file for more info.
Expand Down
8 changes: 4 additions & 4 deletions RJImageLoader.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Pod::Spec.new do |s|
s.name = "RJImageLoader"
s.version = "0.1.0"
s.version = "0.2.0"
s.summary = "A neat image loader for iOS based on Michael Villar's design."
s.description = <<-DESC
RJImageLoader is a category on UIImageView that lets you add a circular progress and reveal animation when loading images from the network. It is agnostic to the image download process, has a simple interface, and is very easy to integrate.
Expand All @@ -25,9 +25,9 @@ Pod::Spec.new do |s|
s.requires_arc = true

s.source_files = 'Pod/Classes/**/*'
s.resource_bundles = {
'RJImageLoader' => ['Pod/Assets/*.png']
}
#s.resource_bundles = {
# 'RJImageLoader' => ['Pod/Assets/*.png']
#}

# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
Expand Down

0 comments on commit e2eaba7

Please sign in to comment.