Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
@objc func didPanView(sender: UIPanGestureRecognizer) {
let viewToMove = sender.view!
view.bringSubview(toFront: viewToMove)
let translation = sender.translation(in: view)
let newCenter = CGPoint(x: + translation.x, y: + translation.y) = newCenter
sender.setTranslation(, in: view)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment