Skip to content

Instantly share code, notes, and snippets.

@jverkoey
Created January 24, 2017 21:37
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 jverkoey/74a7ff65eaa4f12db763ccd8375e87a0 to your computer and use it in GitHub Desktop.
Save jverkoey/74a7ff65eaa4f12db763ccd8375e87a0 to your computer and use it in GitHub Desktop.
let square2Reactive = runtime.get(square2.layer)
let pan = runtime.get(UIPanGestureRecognizer())
let rawPosition = createProperty(withInitialValue: square2.layer.position)
runtime.add(pan.translated(from: rawPosition, in: view), to: rawPosition)
runtime.add(rawPosition.y().rubberBanded(below: 50, above: 400, length: 100), to: square2Reactive.positionY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment