Can't make URL clickable in UITextView

≯℡__Kan透↙ 提交于 2019-12-01 15:35:06

Check the "Selectable" and "Links" checkboxes in the textview Attributes Inspector:

Dixit Patel

Try to use this Hope this help to you

Links are not clickable by default in a UITextView. But luckily they can be enabled with a few simple lines of code:

self.review.editable = NO;
self.review.selectable = YES;//required
self.review.dataDetectorTypes = UIDataDetectorTypeLink;

Unfortunately you cannot have an editable UITextView with clickable links. If you set editable to YES, then all links will be treated as regular text.

EDIT

Have u check properly it may be UITextview disable in your .xib file.

The issue was that User Interaction Enabled wasn't checked at the bottom of the View section of IB's Attributes Inspector.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!