detect touchesEnded in a scrollview
so I have a scroll vie开发者_Python百科w and what I would like is that when I end my touch (touchesEnded) in this scroll view : (do something) but it doesn't detect my touchesended I don't know why. How can I solve this please .sorry for my english I'm french :/
Subclass uiScrollview like this and it should work: In .h file:
@interface MyScrollView : UIScrollView {
}
@end
In .m file:
@implementation MyScrollView
- (void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event {
if (!self.dragging) {
[self.nextResponder touchesEnded: touches withEvent:event];
}
[super touchesEnded: touches withEvent: event];
}
@end
精彩评论