Last active
December 23, 2016 10:10
-
-
Save andresbrun/a190d5e824b5764f8d9557dea6d26a72 to your computer and use it in GitHub Desktop.
Shows how to create an animator, a behaviour and configure them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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