rounak / RJImageLoader

A recreation of the image loader animation created by Michael Villar for iOS
MIT License
832 stars 88 forks source link

Added startLoaderWithColor: #3

Closed bguidolim closed 9 years ago

rounak commented 9 years ago

UIView has a tintColor property already right? We can use that along with tintColorDidChange

bguidolim commented 9 years ago

You are absolutely right.

rounak commented 9 years ago

Another suggestion: In initWithFrame: in RJCircularLoaderView you can use the tintColor to initialise the strokeColor:

_circlePathLayer.strokeColor = self.tintColor.CGColor;

Then, there's no need for startLoaderWithColor:. Just startLoader and to change the color, users of the library can change the tintColor, which we can document in the README.

bguidolim commented 9 years ago

I don't think so, which color will be default by this way? We don't need to set a color in initWithFrame: because tintColorDidChange handles it for us. About startLoaderWithColor:, I consider a "nice to have".

rounak commented 9 years ago

The default iOS tintColor is a shade of dark blue, which works well IMO. Let's do this. Set strokeColor to be default tintColor in init, and then change the methods below a little in this way:

- (void)startLoader
{
    RJCircularLoaderView *loaderView = self.rj_circularLoaderView;
    loaderView.frame = self.bounds;
    [self addSubview:loaderView];
    loaderView.progress = 0;
}

- (void)startLoaderWithTintColor:(UIColor *)color
{
    [self startLoader];
    self.rj_circularLoaderView.tintColor = color;
}
rounak commented 9 years ago

Thanks a lot @bguidolim!

bguidolim commented 9 years ago

You're welcome!

Could you create a tag 0.2.0 and update Podspec in the cocoapods specs repo? I'm using in a project already :)

rounak commented 9 years ago

On it!

rounak commented 9 years ago

Should be available now

Rounak

On Tue, Feb 24, 2015 at 11:10 PM, Bruno Guidolim notifications@github.com wrote:

You're welcome!

Could you create a tag 0.2.0 and update Podspec in the cocoapods specs repo? I'm using in a project already :)

Reply to this email directly or view it on GitHub https://github.com/rounak/RJImageLoader/pull/3#issuecomment-75805121.

bguidolim commented 9 years ago

Many thanks ;)

On Tue Feb 24 2015 at 3:18:47 PM Rounak notifications@github.com wrote:

Should be available now

Rounak

On Tue, Feb 24, 2015 at 11:10 PM, Bruno Guidolim <notifications@github.com

wrote:

You're welcome!

Could you create a tag 0.2.0 and update Podspec in the cocoapods specs repo? I'm using in a project already :)

Reply to this email directly or view it on GitHub https://github.com/rounak/RJImageLoader/pull/3#issuecomment-75805121.

— Reply to this email directly or view it on GitHub https://github.com/rounak/RJImageLoader/pull/3#issuecomment-75813654.