# Step 4: Hook up to touch events

**URL:** <https://forums.kodeco.com/t/step-4-hook-up-to-touch-events/26542>\
**Category:** 2D iOS & tvOS Games by Tutorials\
**Created:** [February 23, 2017, 9:45am UTC](https://forums.kodeco.com/t/step-4-hook-up-to-touch-events/26542 "2017-02-23T09:45:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdilisa](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/gdilisa/32/81494_2.png) [@gdilisa](https://forums.kodeco.com/u/gdilisa)\
**Post date:** [February 23, 2017, 9:45am UTC](https://forums.kodeco.com/t/step-4-hook-up-to-touch-events/26542/1 "2017-02-23T09:45:11Z")

</div>

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)  
}
