7 Answers
7

Actually you can do this, I have done it on the Mac, had to do with passing down the events. Search online you should be able to find some pointers. I remember it took me a while to solve it a while back.

If the UIButton is behind the UIScrollView, then it cannot respond to touches because there is a UIScrollView in the way! Put the UIButton on the UIScrollView or shrink the UIScrollView so that it no longer obstructs the button.

For newbies like me who come to look for help, here is how you do it in Storyboard: drag the button to the same level as the scrollView, and make sure the button is BELOW the scrollView - the order matters! The lower the position, the topper the view layer is

I had this problem today, after much time investigating is pretty difficult to achieve, because you can lose the dragging ability in exchange for the buttons click event.

However: I ended up with this, a UIScrollView subclass whose receives the button or buttons to which it is interested in catching the event.

The key is to use [(UIControl*)view sendActionsForControlEvents: UIControlEventTouchUpInside];, because calling touchesBegan method not always works as expected. This won't change the GUI as you press the button but you can implement that as needed in a custom method.