Figuring Out When the Animation Is Done
To detect when the animation completes and reset the toy view position, add the following delegate method:
Then, arrange for the method to be called when the animation ends by adding the code in bold to the animation bock in viewDidAppear:.
Now, save your code, and run it to see what happens. As you can see, the view stays put this time because you reset its position to where it was when the animation started.
ONE MORE THING
You may have noticed that there are a few different ways to position a view. ...