Created
December 21, 2016 11:09
-
-
Save andresbrun/0f12831f5467c0cddc49fef85eaf492a to your computer and use it in GitHub Desktop.
Shows how to configure UISnapBehavior
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 snapBehaviour = UISnapBehavior(item: targetView, snapTo: CGPoint(x: 100, y: 100)) | |
animator.addBehavior(snapBehaviour) | |
// You can configure the oscillation of the item when it has to go to the snap point | |
snapBehaviour.damping = 0.5 // Medium oscillation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment