Reputation: 29872
I would simply to add bold or italic to portions of my text. Is there some built in parse that makes this simple, as most the examples I've seen show about a page worth of code, which requires doing substring range calculations on the string. Ideally, I could do something like this:
label.attributedText = [NSAttributedString initWithXXX:@"Some **bold** and *italic text*"];
Upvotes: 2
Views: 1246
Reputation: 1685
MGPushParser in MGBoxKit supports this for bold, italics, underlining, and monospacing, and coloured text.
"**bold**, //italics//, __underlined__, `monospaced`, and {#0000FF|blue}"
Upvotes: 1
Reputation: 50099
https://github.com/Cocoanetics/DTCoreText supports all the markup you can think of ^^
even css to NSAttributedString is possible.
See the attached Examples. It works fine with UIKit
Upvotes: 1