mattt/TTTAttributedLabel — pull request #139 by scalessec (2012-11-16 02:56:32+00:00)
Title: Active links don't always switch back to inactive on touch end

Active links don't always switch back to inactive in `touchesEnded:WithEvent:`. In my test I'm using HelveticaNeue-Medium size 40.0 with the only difference between active and inactive links being text color. Touching the bottom edge of a character in the linked text consistently reproduces the bug.

It seems that `[self linkAtPoint:[touch locationInView:self]]` is returning nil in this case. I added some logging in touch start, touch end, touch moved, and touch canceled, to see if the touch point matches the location of an active link. Here's my log:

2012-11-15 21:34:42.643 TTTLabelTest[6923:907] start: (85.000000, 251.000000)
2012-11-15 21:34:42.646 TTTLabelTest[6923:907] match
2012-11-15 21:34:42.722 TTTLabelTest[6923:907] end: (87.000000, 261.000000)
2012-11-15 21:34:42.725 TTTLabelTest[6923:907] no match

It seems that there's some variance between the start and end points, without a move event fired in between.

Is the linkAtPoint: check necessary in touchesEnded? Shouldn't all links technically be inactive once a finger leaves the screen?