Created
January 21, 2018 16:53
-
-
Save mczachurski/a12d9545eb8916a904fd4ca8a5ec56d1 to your computer and use it in GitHub Desktop.
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
override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent) { | |
super.touchesMoved(touches, with: event) | |
if state == .failed || touches.count != 2 { | |
return | |
} | |
let window = view?.window | |
let arrayTouches = Array(touches) | |
// First finger | |
if let loc = arrayTouches.first?.location(in: window) { | |
firstTouchedPoints.append(loc) | |
state = .changed | |
} | |
// Second finger | |
if let loc = arrayTouches.last?.location(in: window) { | |
secondTouchedPoints.append(loc) | |
state = .changed | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment