Detect URL in NSString
问题 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 . 回答1: Absolutely. Use NSDataDetector (NSDataDetector Class Reference) 回答2: I guess you are familiar with regexes to detect URLs, so in order to get one or the other type of view in your cell, you can simply return two