I have text written using Core Text in my iPhone app. I use NSAttributedString
to set specific styles in the text for given ranges.
It seems I can not find the attribute to set the background / highlight, although it seems to be possible. I could not find an attribute name constant that sounds relevant, and only the documentation lists:
kCTCharacterShapeAttributeName kCTFontAttributeName kCTKernAttributeName kCTLigatureAttributeName kCTForegroundColorAttributeName kCTForegroundColorFromContextAttributeName kCTParagraphStyleAttributeName kCTStrokeWidthAttributeName kCTStrokeColorAttributeName kCTSuperscriptAttributeName kCTUnderlineColorAttributeName kCTUnderlineStyleAttributeName kCTVerticalFormsAttributeName kCTGlyphInfoAttributeName kCTRunDelegateAttributeName
Craig Hockenberry, the developer of Twitterrific, has publicly stated on Twitter that he uses Core Text to render tweets, and Twitterrific has this background / highlight, which I'm talking about when you touch the link.

Any help or pointers in the right direction would be fantastic, thanks.
Edit: Here, the link to the Craig tweet posted a mention of โBody text, attribute strings and a lot of hard workโ and that are referenced using CTFrameSetter metrics to design if touches intersect with links.
ios iphone highlight core-text nsattributedstring
Jasarien
source share