UIKit Dynamics

1,484 views

Published on

A basic overview of UIKit Dynamics. Demo here: https://github.com/rob-brown/Demos

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

No Downloads
Views
Total views
1,484
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
45
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

UIKit Dynamics

  1. 1. UIKit Dynamics Robert Brown Twitter: @robby_brown ADN: @robert_brown
  2. 2. What is UIKit Dynamics? A composable, reusable, declarative, real-world inspired animation and interaction system.
  3. 3. What is UIKit Dynamics? Based on real-world interactions Gravity Collisions Attachments Snap Forces Weight
  4. 4. Limitations It is possible to create behaviors that can’t be satisfied Not completely accurate physics Does not replace Core Animation, UIView animations, or motion effects Only supports 2D transforms
  5. 5. UIGravityBehavior Gravity is a simple vector Default is (0, 1) meaning straight down Default constant is 1000 px/sec2
  6. 6. UICollisionBehavior Views can collide with boundaries and other views Views can collide conditionally with other views Callbacks for when collisions begin and end (UICollisionBehaviorDelegate) Collisions have a CPU cost
  7. 7. UIAttachmentBehavior Acts like a rope, string, or spring Damping is customizable Has a length and two anchor points Attachments are invisible
  8. 8. UISnapBehavior Locks position and angle Can use damping
  9. 9. UIPushBehavior Simple force vector 1 UIKit Newton accelerates a (100,100) view by 100 px/sec2
  10. 10. UIDynamicItemBehavior friction resistance angularResistance elasticity density allowsRotation
  11. 11. Composing Behaviors Effect Combination Bounce Gravity + collision Drag and snap Attachment then snap Lock screen Gravity + Collision + Attachment + Push Magnet Multiple push
  12. 12. Demo
  13. 13. Questions?
  14. 14. Want to Learn More? WWDC 2013 Session 206 WWDC 2013 Session 221 UIKit Dynamics Catalog Sample

×