Krelborn / KILabel

A simple to use drop in replacement for UILabel for iOS 7 and above that highlights links such as URLs, twitter style usernames and hashtags and makes them touchable.
MIT License
470 stars 132 forks source link

Text bounds not exactly the same as a normal UILabel #7

Closed Krelborn closed 9 years ago

Krelborn commented 10 years ago

Text bounds are not exactly the same as a normal UILabel. This means the KILabel is rendered in a rectangle that doesn't correspond with the method [@"string" boundingRectWithSize:options:attributes:context:](as UILabel does).

Krelborn commented 9 years ago

Not sure what can be done about this and even if its that big a deal. TextKit is doing the measuring and the layout manager appears to break lines differently to UILabel in some cases. We could probably make little hacks to KILabel to make the measurements the same but that would be second guessing Apple's implementation which could change.

Going to leave this open. In the meantime I've added IB_DESIGNABLE to KILabel so it draws inside Interface Builder. Means you will have consistent layout with text entered in IB and runtime.

Krelborn commented 9 years ago

Fix for issues #18 partially addresses this although there is still some drift in text rendering. Am closing this now because I think it's a non-issue.