A category on NSMutableAttributedString to add HTML features for UIKit that normally only available in AppKit The OSX documentation is here
Originally extracted from Push
#import "NSMutableAttributedString+HTML.h"
NSString * htmlString = @"This is a <a href=\"http://www.example.com\">sample</a> html file";
NSMutableAttributedString * bodyAttributedText = [[NSMutableAttributedString alloc]
initWithHTML:[htmlString dataUsingEncoding:NSUTF8StringEncoding]
documentAttributes:nil];
NSString * htmlStringWithoutBaseURL = @"This is a <a href=\"/test/url\">sample</a> html file";
NSMutableAttributedString * bodyAttributedText = [[NSMutableAttributedString alloc]
initWithHTML:[htmlStringWithoutBaseURL dataUsingEncoding:NSUTF8StringEncoding]
baseURL:@"http://www.example.com"
documentAttributes:nil];
Christopher Guess [email protected]