Q:

iOS: Adding non zooming buttons to zoomable image

have looked but can't find a solution to this on SO.
The problem: I would like to add buttons to a UIImageView that is zoomable however when the image zooms in, the buttons remain in the same place on the image but do not zoom (ie they stay the same size). This is similar to what Maps does if it has many pins on the map, when you zoom in on the Map if the pins are close together they spread apart and stay the same size, rather than zooming to huge sizes with the map!
My attempt: I understand how to make the image zoom, through use of a scroll view however I am unsure of what the view hierarchy should be. The button locations depend on the image and so you cannot add the buttons to just the scroll as they wouldn't move when zooming. However, if I add the buttons to the image view then they zoom with the image (since I return the image view for the delegate method viewForZoomingInScrollView). I have tried tinkering with an overlayer for the buttons with clues from Zooming a background image without zooming the overlay but haven't found anything that works yet.
Any help is greatly appreciated, thanks a lot!

A:

You should not add the button as a subview to the scroll view. Instead, try adding the button as a subview to your scroll view's superview.
[superview addSubview:scrollView];
[superview addSubview:button];

Your view hierarchy will look like this:
<superview>
    <scrollView>
    <button>

Since the button is not a subview of the scroll view, it won't get zoomed.

