-
Notifications
You must be signed in to change notification settings - Fork 57
Description
tapViewAtPoint maps the coordinates of the given point like this:
- (CGPoint) tapView:(UIView *)view atPoint:(CGPoint)point{
CGPoint tapPoint = [self tapCoordsForView:view atPoint:point];
Whereas other tap/touch methods like longTapViewAtPoint do the coordinate mapping like this:
- (CGPoint) longTapView:(UIView *)view atPoint:(CGPoint)point forDuration:(NSTimeInterval)duration{
CGPoint tapPoint = [view convertPoint:point toView:nil];
I don't understand why these mappings are different, nor how anyone else can use them when they don't work correctly for me. When I replace the coordinate mapping in longTapViewATPoint above with a clone of the mapping from tapViewAtPoint:
CGPoint tapPoint = [self tapCoordsForView:view atPoint:point];
then longTapViewAtPoint works correctly.
doubleTapViewAtPoint has the same problem, with the same fix. I've tested both these fixes and am prepared to generate a PR on TestingWithFrank/PublicAutomation to share my fixes. However I suspect that more needs fixing, since there are several other occurrences of the incorrect:
CGPoint tapPoint = [view convertPoint:point toView:nil];
mapping in the code, but in methods that my test cases do not exercise. I haven't touched these yet, until I can be sure that I'm correct in making such a global change to the coordinate mapping.