1
1
mirror of https://github.com/exyte/Macaw.git synced 2024-08-16 00:20:23 +03:00

Avoid force unwrapping of the initial touch index

This commit is contained in:
Aurelius Prochazka 2018-09-03 00:58:09 -07:00
parent 654df3ab69
commit 46d8a81739

View File

@ -296,7 +296,9 @@ open class MacawView: MView, MGestureRecognizerDelegate {
var points = [TouchPoint]()
for initialTouch in initialTouches {
let currentIndex = touches.index(of: initialTouch)!
guard let currentIndex = touches.index(of: initialTouch) else {
continue
}
let currentTouch = touches[currentIndex]
let location = CGPoint(x: currentTouch.x, y: currentTouch.y)
let inverted = currentNode.place.invert()!