Animation Completion

It can often be useful to know when an animation completes. For instance, you might want to chain different kinds of animations together or update another object when the animation completes. To know when the animation finishes, pass a block for the completion argument.

Update BNRHypnosisViewController.m so that it logs a message to the console when the animations complete.

[​U​I​V​i​e​w​ ​a​n​i​m​a​t​e​K​e​y​f​r​a​m​e​s​W​i​t​h​D​u​r​a​t​i​o​n​:​1​.​0​ ​d​e​l​a​y​:​0​.​0​ ​o​p​t​i​o​n​s​:​0​ ​a​n​i​m​a​t​i​o​n​s​:​^​{​
 ​ ​ ​ ​[​U​I​V​i​e​w​ ​a​d​d​K​e​y​f​r​a​m​e​W​i​t​h​R​e​l​a​t​i​v​e​S​t​a​r​t​T​i​m​e​:​0​ ​r​e​l​a​t​i​v​e​D​u​r​a​t​i​o​n​:​0​.​8​ ​a​n​i​m​a​t​i​o​n​s​:​^​{​
 ​ ​ ​ ​ ​ ​ ​ ​m​e​s​s​a​g​e​L​a​b​e​l​.​c​e​n​t​e​r​ ...

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.