Swift - pinch zoom multiple images
<p>I have a scrollview which holds an imageview, which by itself pinches and zooms just fine. My issue is when I'm programmatically adding additional imageviews to the scrollview, they are then doing the zooming and not the main scrollview. In fact, the scrollView is then "locked" for panning and zooming.</p>

<p>What I want to do is "sync" all the images I place on the scrollview to respond to pinch and zoom, so that everything appears in the right "scale" size at whatever zoomScale I end up with.</p>

<p>This is how I place new images on the screen:</p>

<pre><code>let singleTapRecognizer = UITapGestureRecognizer(target: self, action: "scrollViewSingleTapped:")
    singleTapRecognizer.numberOfTapsRequired = 1
    singleTapRecognizer.numberOfTouchesRequired = 1
    scrollView.addGestureRecognizer(singleTapRecognizer)
</code></pre>

<p>And this is the routine that adds the images: </p>

<pre><code>imageView = UIImageView(image: UIImage(named: "Fingerprint36x36.png"))
    imageView.tag = 1999
    imageView.center = CGPoint(x: pointInView.x, y: pointInView.y);

    scrollView.addSubview(imageView)
</code></pre>

<p>Once this happens, it appears that "self" becomes the new view control, and not the scrollView.  </p>

<p>So I "think" my question is: How do I keep the gestureRecognizer focused on the ScrollView and not the "top most" imageView?</p>

<p>I do not have any code setup for UIPinchGestureRecognizer. It just works by default since I'm using the ScrollView.</p>

<p>Thanks for your help.  :)
Mark</p>