- touch and hold button - start task and show slide-to-cancel slider
- end touch without sliding - finish task and remove slide-to-cancel slider
- start sliding to right without ending touch - cancel the task
- finish sliding and end touch - remove slide-to-cancel slider
I am thinking to add to transparent UIView on top and forward the touch event to the subview that is UIButton and UISlider with help of hitTest: withEvent function.
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
CGPoint hitPoint = [underneathView convertPoint:point fromView:self];
if ([underneathView pointInside:hitPoint withEvent:event]){
NSLog(@"UnderneathView");
return underneathView;
}
NSLog(@"not UnderneathView");
return [super hitTest:point withEvent:event];
}
But i am not sure how to use it properly. Please provide me some example/tutorial or suggest me a right way to go.
Thanks