I would like to use the scrolling/panning functionality of the UIScrollView but I would like to handle all the zooming and scaling myself. My current plan is to have a viewController that owns a UIView (I’ll call it view1) with multiple UIViews and UIScrollViews as children.
Is it possible for view1 to handle all multi-touch events (in order to manually render all his children’s zoomed states) and draw the results onto each respective scroll view to allow a user to scroll around the results?
(For the curious, the application is drawing multiple heatmaps, each with its own set of axes. While zooming or scrolling, the axes need to update themselves to correctly label the ranges represented in the data region (the scroll view). The reason I can’t use the default context-image-scaling zoom that comes for free with the scrollView is that ANYthing drawn on the context zooms (including things like reference lines). The zooming action is not to actually make things bigger but to adjust the viewable data range.)
Thanks for your suggestion brad. the solution I ended up using was to extend UIScrollView and override the touchesMoved:withEvent: method with this:
where ‘content’ is a pointer to my scrollview’s content subview. I had to do it this way because my content needs to zoom-to-point (ie, the points in data-space under the user’s fingers shouldn’t change). The information sent to setTransform: can only tell me the size of the content frame, but I also need the offset into it.