Skip to content

Instantly share code, notes, and snippets.

@andresbrun
Last active December 23, 2016 10:10
Show Gist options
  • Save andresbrun/a190d5e824b5764f8d9557dea6d26a72 to your computer and use it in GitHub Desktop.
Save andresbrun/a190d5e824b5764f8d9557dea6d26a72 to your computer and use it in GitHub Desktop.
Shows how to create an animator, a behaviour and configure them
let animator = UIDynamicAnimator(referenceView: containerView)
let gravityBehaviour = UIGravityBehavior(items: [targetView])
gravityBehaviour.magnitude = 1.0 // gravity on earth
animator.addBehavior(gravityBehaviour)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment