Saurabh 😎

WWDC 2012: iOS App Performance: Graphics and Animations

2 parts to performance:
Responsiveness - animation begins immediately after user action
Smooth - no dropped frames during animation

Scrolling is a special type of animation

Performance workflow:

Especially important to be methodical for graphics/animations since some techniques can help or hurt (so can't just blindly follow advice)

Every UIView is backed by a CALayer

3 steps to animation:

What delays an animation? (remember that more delays = less responsiveness)

Note: all drawing and layout is done upfront; even if a view doesn't appear until frame 15, will still do layout/draw at beginning

First need to determine whether you bottleneck is CPU bound vs GPU bound

If GPU bound, use Core Animation instrument

Color Blended Layers


Final tip: different devices may have different bottlenecks - some CPU-bound, some GPU-bound, so test on variety of devices