     }
     
     private func animateText() {
-        textColorAnimation = CABasicAnimation(keyPath: AnimationKeyType.foregroundColor.keyPath)
+        let textColorAnimation = CABasicAnimation(keyPath: AnimationKeyType.foregroundColor.keyPath)
         textColorAnimation.duration            = animationDuration
         textColorAnimation.autoreverses        = true
         textColorAnimation.repeatCount         = AnimationConstants.repeatCount

final class SYLayer {
    
    private var superLayer: CALayer!
    private var textLayer = CATextLayer()
    private var rippleLayer = CALayer()
    private var subRippleLayer = CALayer()
    
    private var borderColorAnimtion = CABasicAnimation()
    private var borderWidthAnimation = CABasicAnimation()
    private var shadowAnimation = CABasicAnimation()
    private var backgroundColorAnimation = CABasicAnimation()
    private var textColorAnimation = CABasicAnimation()
    
    private var animationBorderColor = AnimationDefaultColor.border {
        didSet {
            borderColorAnimtion.toValue = animationBorderColor.CGColor
            animationShadowColor = animationBorderColor
        }
    }
    private var animationTextColor = AnimationDefaultColor.text {
        didSet {
            textColorAnimation.toValue = animationTextColor.CGColor
        }
    }
    private var animationBackgroundColor = AnimationDefaultColor.background {
        didSet {
            backgroundColorAnimation.toValue = animationBackgroundColor.CGColor
        }
    }
    private var animationShadowColor = AnimationDefaultColor.border {
        didSet {
            superLayer.shadowColor = animationShadowColor.CGColor

        resetSuperLayerShadow()
    }
    
    private func configureBorderAnimation() {
        configureBorderColorAnimation()
        configureBorderWidthAnimation()
    }
    
    private func configureBorderWithShadowAnimation() {
        configureBorderColorAnimation()
        configureShadowAnimation()
        configureBorderWidthAnimation()
    }
    
    private func configureBorderColorAnimation() {
        borderColorAnimtion.fromValue = AnimationKeyType.borderColor.fromValue
        borderColorAnimtion.toValue   = animationBorderColor.CGColor
    }
    
    private func configureBorderWidthAnimation() {
        borderWidthAnimation.fromValue = AnimationKeyType.borderWidth.fromValue
        borderWidthAnimation.toValue   = AnimationConstants.borderWidth
    }
    
    private func configureShadowAnimation() {
        shadowAnimation.fromValue = AnimationKeyType.shadowOpacity.fromValue
        shadowAnimation.toValue   = AnimationConstants.shadowOpacity
    }
    
