0

on the current project I am working on, on one of the views, I have a UIView and on top of it UIScrollView which is constructed from the interface builder.

I have implemented the following UIResponder instance methods:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

but the control comes to this methods only when touch event occur in area where is not covered by the UIScrollView.

how I can get the hold of a touch event on the UIScrollView also?

Cœur
  • 37,241
  • 25
  • 195
  • 267
shebelaw
  • 3,992
  • 6
  • 35
  • 48
  • Can you show the code where you initialize the scrollView and the code for the view controller that it is contained in? Add the code as an update to your question so the code formatter can be used. – Jim Dec 22 '11 at 23:03

1 Answers1

0

you could create a subclass of UIScrollView and override:

- (BOOL)touchesShouldBegin:(NSSet *)touches withEvent:(UIEvent *)event inContentView:(UIView *)view

you have to be careful that you don't interfere with the scrolling gestures etc tho.

Mike K
  • 2,227
  • 1
  • 12
  • 6
  • thanx Mike, I got it working by subclaseing UIScrollView and implementing the bove two metods with in this class. – shebelaw Dec 23 '11 at 03:19