0
I get from the server an HTML similar to this:
"<br>Dummy text<br>Click <a href="www.google.com">Here</a>"
On Click Here it should be possible to click and open in Safari. I tried to implement the following code: (being textMsg a Textview).
NSAttributedString * attrStr = [[NSAttributedString alloc] initWithData:[[self.myServer textHTML] dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];
[self.textMsg setEditable:NO];
[self.textMsg setScrollEnabled:NO];
[self.textMsg setDataDetectorTypes:UIDataDetectorTypeLink];
self.textMsg.attributedText = attrStr ;
I tried it in other similar ways, but none worked..
On android there is a similar function, Html.fromHtml().
Getting the link this way, there would be a way to get it to redirect to the browser?