Hyperlinks in a UITextView

后端 未结 5 1157
無奈伤痛
無奈伤痛 2020-12-01 16:18

I am trying to create a UITextView with a hyperlink so that when the user clicks on the link, they are taken to safari to open the we

5条回答
  •  庸人自扰
    2020-12-01 16:58

    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:

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

提交回复
热议问题