I'm using Swift & SpriteKit.
I've got my sprite focused (using touches began and touches moved) & would like to click the remote to select it, but keep getting:
unrecognized selector sent to instance
Here's the code I'm using..
let tap = UITapGestureRecognizer(target: self, action: "processItemTouch")
tap.allowedPressTypes = [NSNumber(integer: UIPressType.Select.rawValue)]
view.addGestureRecognizer(tap)
func processItemTouch(nod : SKNode) {
// stuff to do
}
I've tried changing the processItemTouch
to processItemTouch: & processItemTouch(nod : SKNode)
.
Changing the selector to processItemTouch:
should cause the right method to get called, but the argument that gets passed won't be an SKNode
, it'll be a UITapGestureRecognizer
. When gestures call their actions, the argument will be the gesture object that triggered the action.