Starting Core Animation

3,291 views
3,181 views

Published on

Learn about Apple's powerful layer based animation framework to enhance user experience. Topics will include types of animation and layers.

Published in: Technology, Art & Photos
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,291
On SlideShare
0
From Embeds
0
Number of Embeds
36
Actions
Shares
0
Downloads
69
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Starting Core Animation

  1. 1. Starting Core Animation
  2. 2. What is Core Animation? • Framework for easily creating animated user interfaces. • Tightly integrated with UIKit. • Animate properties over time. • Layer based.
  3. 3. Where is Core Animation Used? • Everywhere! • Navigation controllers, displaying modal view controllers, deselecting cells in a table view, flipping to an info screen, etc!
  4. 4. UIView Animation’s • What you need most of the time. • Happens within an animation block: [UIView beginAnimations:nil context:NULL]; // change stuff [UIView commitAnimations];
  5. 5. Customizing, a little. • [UIView setAnimationDuration:] • [UIView setAnimationCurve:] • UIViewAnimationCurveEaseInOut UIViewAnimationCurveEaseIn UIViewAnimationCurveEaseOut UIViewAnimationCurveLinear • Delay, repeat count, etc.
  6. 6. Built-in Transitions • UIViewAnimationTransitionFlipFromLeft • UIViewAnimationFlipFromRight • UIViewAnimationTransitionCurlUp • UIViewAnimationTransitionCurlDown
  7. 7. Transforms • setTransform:(CGAffineTransform) • Rotation, scale, translation, etc
  8. 8. Demo
  9. 9. Layers • 2d object in 3d space. • “Animation Container” • Override layerClass method to change the type of a layer which your view uses.
  10. 10. Layer Types • CALayer • CAScrollLayer • CATiledLayer • CAEAGLLayer
  11. 11. Custom Animations • Link against QuartzCore framework. • Override actionForLayer:forKey: to return custom animation for property changes. • Set animation on a layer directly to trigger an immediate animation.
  12. 12. Animation Types • CABasicAnimation • Go from point A to point B. • CAKeyframeAnimation • Go from A to B to C, etc. • Animate along a path or by setting values and times • Set calculation mode to paced, linear, or discrete. • CAAnimationGroup • Group multiple animations together.
  13. 13. Demo!

×