Skip to content

Instantly share code, notes, and snippets.

@andresbrun
Created December 22, 2016 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andresbrun/91ccdef02f7b3d32e3d1b4a071659c29 to your computer and use it in GitHub Desktop.
Save andresbrun/91ccdef02f7b3d32e3d1b4a071659c29 to your computer and use it in GitHub Desktop.
Shows how to configure a sliding behaviour
let slidingBehaviour = UIAttachmentBehavior.slidingAttachment(with: targetView,
attachedTo: draggableView,
attachmentAnchor: targetView.center,
axisOfTranslation: CGVector(dx: 1, dy: 0))
animator.addBehavior(slidingBehaviour)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment