March 2014
Intermediate to advanced
672 pages
40h 11m
English
Blocks constructs simplify the creation of basic animation effects in your code. Consider the following snippet, which produces a fade-out effect for a view with a single statement in an embedded block:
[UIView animationWithDuration: 1.0f animations:^{contentView.alpha = 0.0f;}];
Adding a completion block lets you tidy up after your animation finishes. The following snippet fades out the content view and then removes it from its superview when the animation completes:
[UIView animationWithDuration: 1.0f animations:^{contentView.alpha = 0.0f;} completion:^(BOOL done){[contentView removeFromSuperview];}];
When you need to add further options ...
Read now
Unlock full access