DGActivityIndicatorView icon indicating copy to clipboard operation
DGActivityIndicatorView copied to clipboard

setTintColor should invoke setupAnimation to prevent bugs of unchanged color

Open peterpaulis opened this issue 7 years ago • 3 comments

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;
//            }
//        }
    }
}

peterpaulis avatar Mar 14 '17 11:03 peterpaulis

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

peterpaulis avatar Mar 14 '17 11:03 peterpaulis

+1

I just ran into the same issue.

tciuro avatar Apr 07 '17 03:04 tciuro

You could send a PR for that. 👍 Will have a look into that this week.

gontovnik avatar Jul 05 '17 16:07 gontovnik