UITextView link detection in iOS 7

后端 未结 17 1345
再見小時候
再見小時候 2020-12-01 10:22

I have a UITextView which is managed via Interface Builder. As data detection I have \"Links\" checked. In iOS 6 everything is working fine and links are highli

17条回答
  •  广开言路
    2020-12-01 10:45

    You should check out NSDataDetector.

    You can use this to find and deal with different data (links, phone numbers and more). Have a look on this site:

    http://nshipster.com/nsdatadetector/

    You can also use the dataDetectorTypes property of UITextView to set what you want to detect in code. May just be a storyboard transition problem for you.

    textView.dataDetectorTypes = UIDataDetectorTypeLink;
    

提交回复
热议问题