I'm using those line of codes to create an attributed string from a simple HTML string:
NSDictionary *importParams = @{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType,NSCharacterEncodingDocumentAttribute: @(NSUTF8StringEncoding) };
NSError *error = nil;
NSData *stringData = [HTML dataUsingEncoding:NSUTF8StringEncoding] ;
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithData:stringData options:importParams documentAttributes:NULL error:&error];
The issue is that is really slow (about seconds on simulator)even for few characters.
I don not understand the reason behind that and I don't want to use third party libs with custom HTML parser.
Is there any other way to create attributed string from HTML text faster than this?