Created
April 12, 2017 18:25
-
-
Save jverkoey/feb3aceaabe802b6e4d7880a0f35f1c6 to your computer and use it in GitHub Desktop.
Directly manipulable constraints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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