I have an NSAttributedString
generated from HTML which includes some links. The attributed string is shown in a UITextView. I wish to apply a different font style f
There's also an easy way to apply style for the text if you use html - you can just add the style within the html code. Then you wouldn't need to worry about setting attributes for the text. For example:
NSString *html = [NSString stringWithFormat:@"%@ %@ on %@
", name, taskName, timeString];
NSDictionary *options = @{NSDocumentTypeDocumentAttribute : NSHTMLTextDocumentType};
NSData *data = [html dataUsingEncoding:NSUTF8StringEncoding];
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithData:data options:options documentAttributes:nil error:nil];