开发者

How to make a clickable link in UITextView

开发者 https://www.devze.com 2023-03-19 05:34 出处:网络
开发者_运维百科I am developing an iphone app right now where i will be displaying an overview text with entries that can be found later in the app.I am wondering if there is a way to make a specific w

开发者_运维百科I am developing an iphone app right now where i will be displaying an overview text with entries that can be found later in the app. I am wondering if there is a way to make a specific work clickable to send me to another screen that will display more information about the place that was clicked.


You can use this...

self.myTextView.dataDetectorTypes =UIDataDetectorTypeLink;


if you want active substring in your UITextView then you can use my extended TextView... its short and simple. You can edit it as you want.

how to use (range = substring location):

[self.textView addTapActionWithRange:range withActionBlock:^{
      // anything you want to do - show something
}];

result:

How to make a clickable link in UITextView

source code: https://github.com/marekmand/ActiveSubstringTextView

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号