简体   繁体   中英

uitextview dataDetectorTypes doesn't work with short links like bitly links

When UITextView dataDetectorTypes is enabled, all links in the text does look clickable. But any "short links" like ( http://bit.ly/link ) are not clickable (even though the UITextView does draw them as links).

Is there any way to add/modify the detection algorithm to make also these links clickable? (In a way that does not use private APIs and the app can still be submitted to the app store).

The link should be auto-detected and tappable without a problem. Make sure that:

  1. Your UITextView instance isn't editable
  2. Your UITextView dataDetectorTypes includes UIDataDetectorTypeLink

在此输入图像描述

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM