title: How can I detect the touch event in the UIScrollView?
body: <p>In my program, I want the image in the scroll view can be detected when there is a touch. I had read the internet that there are some codes that can help to solve the problem
  In a subclass .h file:</p>
  
  <pre><code>@interface AllScrollView : UIScrollView 
  {
  }
  
  @end 
  </code></pre>
  
  <p>In the subclass .m file:</p>
  
  <pre><code>#import "AllScrollView.h"
  
  @implementation AllScrollView
  
  - (id)initWithFrame:(CGRect)frame 
  {
    return [super initWithFrame:frame];
  }
  
  - (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event 
  {   
    if (!self.dragging) 
      [self.nextResponder touchesEnded: touches withEvent:event]; 
    else
      [super touchesEnded: touches withEvent: event];
  }
  
  @end
  </code></pre>
  
  <p>and then I change the method <code>- (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event</code> on the main class. However, there is nothing happened and I cannot detect the touch. Do I miss something ? Could anyone give a more detail solution ? Thank you so much!</p>