DGActivityIndicatorView
DGActivityIndicatorView copied to clipboard
setTintColor should invoke setupAnimation to prevent bugs of unchanged color
this fixed a bug where the component didn't update proper on tint color change
- (void)setTintColor:(UIColor *)tintColor {
if (![_tintColor isEqual:tintColor]) {
_tintColor = tintColor;
[self setupAnimation];
// CGColorRef tintColorRef = tintColor.CGColor;
// for (CALayer *sublayer in _animationLayer.sublayers) {
// sublayer.backgroundColor = tintColorRef;
//
// if ([sublayer isKindOfClass:[CAShapeLayer class]]) {
// CAShapeLayer *shapeLayer = [[CAShapeLayer alloc] init];
// shapeLayer.strokeColor = tintColorRef;
// shapeLayer.fillColor = tintColorRef;
// }
// }
}
}
or a resetAnimation method could be added, where setupAnimation would be called... as start and stop doesn't invoke the setupAnimation, once the layer exists
+1
I just ran into the same issue.
You could send a PR for that. 👍 Will have a look into that this week.