Detect URL in NSString

cocoa-touch, ios, regex, uilabel, uitextview

Solution

Absolutely. Use NSDataDetector (NSDataDetector Class Reference)

Problem

I'm currently using a `UITextView` in a `UITableViewCell` in order to make links clickable, but this is giving very poor performance. So I was wondering if it's possible to detect links in a `NSString` and if there is a link, use the `UITextView`, otherwise just use a `UILabel`.

Original source