Skip to content

Instantly share code, notes, and snippets.

@tiagomartinho
Last active June 28, 2018 10:41
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 tiagomartinho/e7c2e776402ccb8239ba76453a55c9e8 to your computer and use it in GitHub Desktop.
Save tiagomartinho/e7c2e776402ccb8239ba76453a55c9e8 to your computer and use it in GitHub Desktop.
@objc func didPinchView(gestureRecognizer: UIPinchGestureRecognizer) {
if gestureRecognizer.state == .began || gestureRecognizer.state == .changed {
guard let transform = gestureRecognizer.view?.transform else { return }
let scale = gestureRecognizer.scale
gestureRecognizer.view?.transform = transform.scaledBy(x: scale, y: scale)
gestureRecognizer.scale = 1.0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment