title: Detect touch location in UIImage which is in a scrollview
body: <p>I have the following UI hierarchy:</p>
  
  <p>UIView -> UIScrollView -> UIImageView</p>
  
  <p>It was necessary because i wanted to zoom my image in and out. So far so good and everything works. Now i wanted to detect the touch location of the image. I've read already a lot and it works if i just have an UIImage in an UIView. Unfortunately i need it for the first described hierarchy.</p>
  
  <pre><code>class TestController: UIViewController, UIScrollViewDelegate {
  
      @IBOutlet weak var scrollView: UIScrollView!
      @IBOutlet weak var myImageView: UIImageView!
      @IBOutlet var myGestureRecognizer: UITapGestureRecognizer!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          self.myImageView.addGestureRecognizer(myGestureRecognizer)
          myImageView.userInteractionEnabled = true
  
      }
  
      override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
          let touch = touches.anyObject()! as UITouch
          let location = touch.locationInView(self.myImageView)
          println(location)
      }
  
      func viewForZoomingInScrollView(scrollView: UIScrollView) -&gt; UIView? {
          return self.myImageView
      }
  
      .....
  }
  </code></pre>
  
  <p>I've tried to add "myGestureRecognizer" to UIView and also to the UIImageView and even to all 3 (UIView, UIScrollView, UIImageView) together. It just doesn't work for me and I don't know what to do.</p>
  
  <p>How can I detect the location of touches (just single tap) in a UIImageView, which is placed in a UIScrollView?</p>
  
  <p>Thanks in advance!</p>