I'm generating CALayer
when user taps the screen. Then I'm translating that layer to certain position using Animation
. Then I'm removing it using this code in animationDidStop
:
[mylayer removeFromSuperLayer];
Here everything is working fine, but when I tap again before the previous animation stops, my current layer is not removed from the superlayer. How do I removed it under these circumstances?