You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It would be nice if we could support rendering an NSTextAttachment inside an attributed string, typically used to render icons inline with a label's text.
Describe the solution you'd like
When attributedText contains an NSTextAttachment, render the attachment image inline with the rest of the text, similar to how UILabel renders these.
Rendering NSTextAttachment's in UILabel is likely managed by TextKit's NSLayoutManager, which we're bypassing and substituting with our own CoreText drawing in NantesLabel's implementation. Making it work with CoreText might not be practical/possible.
Describe alternatives you've considered
Just use UILabel itself, but you lose out on the benefits of NantesLabel. :D
Explore not overriding func drawText(in rect: CGRect) and let UILabel do the rendering. Not sure if we can do this and still support the current features.
Additional context
TTTAttributedLabel itself does not support NSTextAttachment
Is your feature request related to a problem? Please describe.
It would be nice if we could support rendering an
NSTextAttachment
inside an attributed string, typically used to render icons inline with a label's text.Describe the solution you'd like
When
attributedText
contains anNSTextAttachment
, render the attachment image inline with the rest of the text, similar to howUILabel
renders these.Examples of usage:
Technical complexity
NSTextAttachment
's inUILabel
is likely managed by TextKit'sNSLayoutManager
, which we're bypassing and substituting with our own CoreText drawing inNantesLabel
's implementation. Making it work with CoreText might not be practical/possible.Describe alternatives you've considered
UILabel
itself, but you lose out on the benefits ofNantesLabel
. :Dfunc drawText(in rect: CGRect)
and letUILabel
do the rendering. Not sure if we can do this and still support the current features.Additional context
TTTAttributedLabel
itself does not supportNSTextAttachment
The text was updated successfully, but these errors were encountered: