diff --git a/TSLabel/TSLabel.m b/TSLabel/TSLabel.m index c0d1c54..a9fb7c8 100644 --- a/TSLabel/TSLabel.m +++ b/TSLabel/TSLabel.m @@ -71,7 +71,8 @@ - (void) layoutManager: (NSLayoutManager *) layoutManager didCompleteLayoutForTe NSRange glyphRange = [layoutManager glyphRangeForCharacterRange: range actualCharacterRange: nil]; CGRect bounds = [layoutManager boundingRectForGlyphRange: glyphRange inTextContainer: textContainer]; - link.bounds = CGRectOffset(bounds, 0, (label.bounds.size.height-containerGlyphBounds.size.height)/2); + CGRect boundsOffset = CGRectOffset(bounds, 0, (label.bounds.size.height-containerGlyphBounds.size.height)/2); + link.bounds = CGRectMake(boundsOffset.origin.x - 7.5, boundsOffset.origin.y - 7.5, boundsOffset.size.width + 15, boundsOffset.size.height + 15); // Make links more tappable by increasing the bounding box [links addObject: link]; } @@ -239,4 +240,4 @@ - (void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *) event [self setAttributedText: self.attributedText]; } -@end \ No newline at end of file +@end