Reputation: 2441
I have a simple question. In my app, I have a some buttons for navigation inside a UIScrollView
, which scroll with the content. This way, when the user enters a text field and the keyboard pops up, the buttons will scroll away for extra space. However, the buttons don't highlight immediately when I tap on them. I've learned that I can eliminate this problem by setting delaysContentTouches
to NO
, but this makes scrolling nearly impossible, because all the UITextFields
and buttons in the view also highlight immediately, stealing the scroll.
I have found a way to only not delay the buttons via a UIScrollView
subclass, so this is an option, but I was wondering if there is another way. I generally hate subclassing when it is to fix just one little thing.
Upvotes: 2
Views: 1654
Reputation: 4289
The touchesShouldBegin:withEvent:inContentView:
method of UIScrollView is intended to be overridden by subclasses if delaysContentTouches
is set to YES. So this is the case when subclassing is completely OK.
Upvotes: 3