Upgrade to Pro — share decks privately, control downloads, hide ads and more …

UIKit Dynamics

Rob Brown
December 11, 2013

UIKit Dynamics

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

Rob Brown

December 11, 2013
Tweet

More Decks by Rob Brown

Other Decks in Technology

Transcript

  1. 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
  2. UIGravityBehavior Gravity is a simple vector Default is (0, 1)

    meaning straight down Default constant is 1000 px/sec2
  3. 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
  4. UIAttachmentBehavior Acts like a rope, string, or spring Damping is

    customizable Has a length and two anchor points Attachments are invisible
  5. Composing Behaviors Effect Combination Bounce Gravity + collision Drag and

    snap Attachment then snap Lock screen Gravity + Collision + Attachment + Push Magnet Multiple push
  6. Want to Learn More? WWDC 2013 Session 206 WWDC 2013

    Session 221 UIKit Dynamics Catalog Sample