I am working on an Application which has some animations going on. If the user presses the homebotton and decides to get back into the application - to the ViewController, where the animations takes place - the ViewController should be displayed as the user just entered it reguarily (Animations start from the beginning). I am using `CABasigAnimation`. Can someone please tell me how to reset the ViewController or something similar?

I was thinking about the Lifecycle of the ViewController, but I was not able to find a method similar to Android Activity's `onRestart()` method, where you can put some code if the userer enters the Activity **again**.

Code for the animation:

```
CAShapeLayer *progressCircle = [CAShapeLayer layer];
//....
[self.view.layer addSublayer:progressCircle];
CABasicAnimation *drawAnimation2 = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];
//....
[progressCircle addAnimation:drawAnimation2 forKey:@"drawCircleAnimation"];

```