Skip to content

setTintColor should invoke setupAnimation to prevent bugs of unchanged color #26

@peterpaulis

Description

@peterpaulis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions