I've 2 animations applied to CAShapeLayer(let's name it `pulseLayer`), with this code : 

```
let scaledAnimation = CABasicAnimation(keyPath: "transform.scale.xy")
scaledAnimation.duration       = 0.75
scaledAnimation.repeatCount    = Float.infinity
scaledAnimation.autoreverses   = true
scaledAnimation.fromValue      = 4
scaledAnimation.toValue        = 4
scaledAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)

let heartBeatAnimation = CABasicAnimation(keyPath: "transform.scale.xy")
heartBeatAnimation.duration       = 0.75
heartBeatAnimation.repeatCount    = Float.infinity
heartBeatAnimation.autoreverses   = true
heartBeatAnimation.fromValue      = 1.0
heartBeatAnimation.toValue        = 1.2
heartBeatAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)

pulseLayer.add(heartBeatAnimation, forKey: "heartBeatAnimation")

```

at some point while `heartBeatAnimation` is on I need to remove heart beat animation and add the scaled animation with this code :

```
pulseLayer.add(self.scaledAnimation, forKey: "scaledAnimation")
pulseLayer.opacity = 0.55
pulseLayer.removeAnimation(forKey: "heartBeatAnimation")

```

but I didn't get any smooth transition between this two animation, even with `UIView.animate()`

so I tried to stay with only one animation `heartBeatAnimation` and change its `toValue` `fromValue` to the same value to get as `scaledAnimation` with this code :

```
heartBeatAnimation.toValue = 4
heartBeatAnimation.fromValue = 4

```

nothing happened while the animation is beating after the animation gone and the user does some gesture to start the animation I got the scaled steady animation...! 

so any ideas how to update these values to make the scaled animation smoother!