Created
March 25, 2016 15:04
-
-
Save jongwonwoo/b7d799441ef5d893b2da to your computer and use it in GitHub Desktop.
This file contains 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
class ViewController: UIViewController { | |
@IBAction func handlePan(recognizer: UIPanGestureRecognizer) { | |
let currentPoint = recognizer.translationInView(self.view) | |
if let stateMachine = self.stateMachine { | |
switch recognizer.state { | |
case .Began, .Changed: | |
stateMachine.keepMoving(currentPoint) | |
default: | |
stateMachine.stopMoving() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment