title: How do I call a touchesBegan function?
body: <p>I simply want to make the position of "mainBall" the position of the touch. How can I call the <code>touchesBegan</code> function?, if i create a override function with <code>touchesBegan</code> outside of the "override function <code>didMoveToView</code>(view: SKView) then it cant access the "mainBall" "SKSpriteNode" and its location because it is inside <code>didMoveToView</code>. I am puzzled, any help is much appreciated in advanced. </p>
  
  <pre><code>import SpriteKit
  import UIKit
  
  let MainBallCategoryName = "mainBall"
  
  class GameScene: SKScene {
  
  override func didMoveToView(view: SKView) {
      super.didMoveToView(view)
  
      var mainBall = childNodeWithName(MainBallCategoryName) as SKSpriteNode
  
      println(mainBall.position)
  
  
  func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
      for touch in touches {
          let location = touch.locationInNode(self)
          mainBall.position = location
  
  
        }
      }
    }
  }
  </code></pre>