bubudrc / MPCoachMarks

MPCoachMarks is an iOS class that displays user coach marks with a couple of shapescutout over an existing UI. This approach leverages your actual UI as part of the onboarding process for your user.
MIT License
629 stars 79 forks source link

Fix MPCoachMarks retain cycle #22

Closed sirnacnud closed 6 years ago

sirnacnud commented 7 years ago

The CABasicAnimation’s delegate is a strong reference to self and by not removing the animation on completion, it creates a retain cycle.

Since we correctly set the layer’s final path, there isn’t a reason to keep the animation around after it finishes. We can just have the animation automatically cleaned up after it completes to break the retain cycle.