Skip to content

Instantly share code, notes, and snippets.

@andresbrun
Created December 21, 2016 11:09
Show Gist options
  • Save andresbrun/0f12831f5467c0cddc49fef85eaf492a to your computer and use it in GitHub Desktop.
Save andresbrun/0f12831f5467c0cddc49fef85eaf492a to your computer and use it in GitHub Desktop.
Shows how to configure UISnapBehavior
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