UIControlEventTouchDragExit triggers when 100 pixels away from UIButton

Override continueTrackingWithTouch:withEvent: like this to send DragExit/DragOutside events inside of the default gutter: – (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event { CGFloat boundsExtension = 25.0f; CGRect outerBounds = CGRectInset(self.bounds, -1 * boundsExtension, -1 * boundsExtension); BOOL touchOutside = !CGRectContainsPoint(outerBounds, [touch locationInView:self]); if(touchOutside) { BOOL previousTouchInside = CGRectContainsPoint(outerBounds, [touch previousLocationInView:self]); if(previousTouchInside) { NSLog(@”Sending UIControlEventTouchDragExit”); [self sendActionsForControlEvents:UIControlEventTouchDragExit]; } else … Read more

Is there any way at all that I can tell how hard the screen is being pressed

You cannot get the pressure from the SDK nor undocumented methods. However you can detect the size of touch with undocumented methods. In the GSEvent, which is a lower-level representation of UIEvent, there is a structure known as GSPathInfo with members: typedef struct GSPathInfo { unsigned char pathIndex; // 0x0 = 0x5C unsigned char pathIdentity; … Read more

Detect if certain UIView was touched amongst other UIViews

In order to check whether certain view inside another view was touched you can use hitTest. – (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event; In your custom implementation of touchesBegan check every touch in touches set. The point for hitTest method can be obtained using – (CGPoint)locationInView:(UIView *)view; method, where the view is your superView (the one that … Read more

UIScrollview getting touch events

Set up a tap gesture recognizer: UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapGestureCaptured:)]; [scrollView addGestureRecognizer:singleTap]; and you will get the touches in: – (void)singleTapGestureCaptured:(UITapGestureRecognizer *)gesture { CGPoint touchPoint=[gesture locationInView:scrollView]; }