Core Animation • Low level objective c rendering and animation classes used by UIView and UIKit • High performance rendering with simple programming model • Lightweight data structure 12年9月10日星期⼀一
• Much like UIView • can set content image, or draw with Quartz 2D • When you change properties, you will trigger implicit animations CALayer Emitter Layer and Cells CALayer with border and corner radius 12年9月10日星期⼀一
• Scrolling • Animation related to motion • Animation related to AVFoundation inputs • Animation related to other continuous event sources In these cases, we need to control frames ourselves 12年9月10日星期⼀一
• Pros: • Won’t miss any data sources • Easier to implement with delegates • Cons: • Does not allow frame drop • Harder to control timing Push based 12年9月10日星期⼀一
Custom CAAnimation • Use CADisplayLink for runloop • CATransaction for stoping implicit animation • Confirms to CAMediaTiming protocol • Use CACurrentMediaTime to pull timestamp 12年9月10日星期⼀一