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.
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.
This is how I place new images on the screen:
let singleTapRecognizer = UITapGestureRecognizer(target: self, action: "scrollViewSingleTapped:")
singleTapRecognizer.numberOfTapsRequired = 1
singleTapRecognizer.numberOfTouchesRequired = 1
scrollView.addGestureRecognizer(singleTapRecognizer)
And this is the routine that adds the images:
imageView = UIImageView(image: UIImage(named: "Fingerprint36x36.png"))
imageView.tag = 1999
imageView.center = CGPoint(x: pointInView.x, y: pointInView.y);
scrollView.addSubview(imageView)
Once this happens, it appears that "self" becomes the new view control, and not the scrollView.
So I "think" my question is: How do I keep the gestureRecognizer focused on the ScrollView and not the "top most" imageView?
I do not have any code setup for UIPinchGestureRecognizer. It just works by default since I'm using the ScrollView.
Thanks for your help. :) Mark