Reputation: 2210
I am using a UILabel
to contain some text. This text may sometimes contain some links like http://www.google.com or www.google.com or even google.com. How do I detect these links and make the text clickable to open in a browser. Please advice. Thanks in advance.
Upvotes: 2
Views: 9241
Reputation: 3541
You can use a UITextView instead and set detection for links:
textView.dataDetectorTypes = UIDataDetectorTypeLink;
Upvotes: 7