I'm drawing with Sprite Kit. I would like to detect when user's drawings are intersecting.
I tried to following code but it doesn't work. It seems sprite kit is not saving all the points:
override func touchesMoved(touches: NSSet, withEvent event: UIEvent) {
/* Called when a touch begins */
touch = touches.anyObject() as UITouch!
for drawingPoint in drawingPoints{
if(touch.locationInNode(self) == drawingPoint){println(true)}
}
drawingPoints.append(touch.locationInNode(self))
}
Here is a function for segments intersection in swift.