As explained in this answer , UIButton or another UIControl, which is a scrolling type view, automatically responds to taps, allowing you to drag the scroll view knob. However, buttons, which are scrolling-type routines, also move with scrolled content, rather than staying at the same position on the screen when the content scrolls under them. I assume that is why you do not want to embed buttons in the scroll bar.
If this happens, you can get the desired behavior with one more step. Put all your buttons in a UIView, which is a preview in the scroll view, and then in the scrollViewDidScroll method of the scroll view delegate, set this frame.origin parameter to the scroll content view of Offset. I just implemented this in my application and it works great, without having to do any subclasses or participate in the responder chain or touch events.
source share