Step 4: Hook up to touch events

iOS Games by Tutorials Chapter 2: Manual Movement

Please Book update required!!

SWIFT 2.1

func sceneTouched(touchLocation:CGPoint) {
moveZombieToward(touchLocation)
}
override func touchesBegan(touches: NSSet,
withEvent event: UIEvent) {
let touch = touches.anyObject() as UITouch
let touchLocation = touch.locationInNode(self)
sceneTouched(touchLocation)
}
override func touchesMoved(touches: NSSet,
withEvent event: UIEvent) {
let touch = touches.anyObject() as UITouch
let touchLocation = touch.locationInNode(self)
sceneTouched(touchLocation)
}

SWIFT 3.0

if let touch = touches.first?.locationInView(self) {
sceneTouhed(touch)
}