This is the code of my CustomUIGestureRecognizer.m
@implementation CustomTapGestureRecognizer
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if(_customDelegate != nil && [_customDelegate respondsToSelector:@selector(onTouchDown:)])
{
[_customDelegate onTouchDown:self];
}
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
if(_customDelegate != nil && [_customDelegate respondsToSelector:@selector(onTouchUp:)])
{
[_customDelegate onTouchUp:self];
}
}
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"cancelled");
}
@end
As can be seen from the code above, I can only detect "touch down" and "touch up" events. But, I need to detect "touch up inside" control event.
I tried to check if the touches cancelled would be triggered when I lift my finger outside the view, this way I would be able to know whether the touch up was inside or not. Unfortunately, it was not called.
Any ideas? Thanks!