Closed travisvalentine closed 11 years ago
Near as I can tell, this is impossible; you can add gesture recognizers, of course, but NSAttributedStrings on iOS cannot include links. The NSLinkAttributeName
setting is missing. :frowning:
Gotcha, thanks @colinta. Just out of curiosity, in the above example how could I best add gesture recognizers to user[:activity_1]
and user[:activity_2]
?
You won't be able to add gestures to those individual links, so I think the way to do this would be to use a UIWebView, or TTTAttributedLabel, which is meant for this kinda thing.
I'm using
sugarcube-attributedstring
in a project and am loving it. However, I'm wondering if there is a way to add actions to the links in the same way I can add them to regular UILabels by usinguserInteractionEnabled
,UITapGestureRecognizer
, andaddGestureRecognizer
. Below is an example of the NSAttributedString syntax I'm working with: