I have a string like this,
var str = "Hello, go to http://stackoverflow.com"
and I want to display this string in a UIWebView, so that http://stackoverflow.com
will be displayed as a link.
To do this, I am using loadHtmlString
of UIWebView.
But the text is not displayed as a link. It is displayed as a normal text in UIWebView.
After some research, I found that the issue is missing of <a href = ""></a> tag
.
For a static string, I can manually add the tags to the string. But I am getting the string from a http response. So I have no idea how to add the <a>
tags in appropriate indices.
Is there any way I could parse and display the text as a link in UIWebView?