Improved accuracy of link label detection.

This commit is contained in:
Kevin G Christiano 2019-09-20 16:11:46 -04:00
parent efbb68b4cd
commit b3cc938a9e

View File

@ -705,7 +705,7 @@ extension UITapGestureRecognizer {
let indexOfGlyph = layoutManager.glyphIndex(for: location(in: label), in: textContainer) let indexOfGlyph = layoutManager.glyphIndex(for: location(in: label), in: textContainer)
return NSLocationInRange(indexOfGlyph, targetRange) return layoutManager.boundingRect(forGlyphRange: targetRange, in: textContainer).contains(location(in: label)) && NSLocationInRange(indexOfGlyph, targetRange)
} }
} }