Skip to content

Instantly share code, notes, and snippets.

@jverkoey
Created April 12, 2017 18:25
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/feb3aceaabe802b6e4d7880a0f35f1c6 to your computer and use it in GitHub Desktop.
Save jverkoey/feb3aceaabe802b6e4d7880a0f35f1c6 to your computer and use it in GitHub Desktop.
Directly manipulable constraints
public final class DirectlyManipulable {
public func add(to view: UIView, withRuntime runtime: MotionRuntime, constraints: NoConstraints)
public final class Constraints {
public var draggable: ConstraintApplicator<T>?
public var rotatable: ConstraintApplicator<T>?
public var scalable: ConstraintApplicator<T>?
}
}
public final class DirectlyManipulable {
public func add(to view: UIView, withRuntime runtime: MotionRuntime, constraints: DirectlyManipulable.Constraints)
}
let manipulable = DirectlyManipulable()
let constraints = DirectlyManipulable.Constraints()
constraints.draggable = { $0.xLocked(to: 100) }
runtime.add(manipulable, to: view)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment