Detecting Touch on SKShapeNode that is a Line
问题 I have an SKShapeNode that I have created and given a CGPath to. This is in my GameScene.swift in didMoveToView: let myNode = SKShapeNode() let lineToDraw = CGPathCreateMutable() CGPathMoveToPoint(lineToDraw, nil, 0, 0) CGPathAddLineToPoint(lineToDraw, nil, 87, 120) myNode.path = lineToDraw myNode.strokeColor = SKColor.redColor() myNode.lineWidth = 20 myNode.name = "My Node!" world.addChild(myNode) // World is a higher-level node in my scene And this is how I'm detecting touches, again in the