Is there a way to create custom UIDataDetectorTypes?

前端 未结 5 1752
忘了有多久
忘了有多久 2020-12-20 07:03

What I am trying to do is create tooltip functionality so that certain words in my instructional app can be tapped and the definition pops up. For the popup part I plan on

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-20 07:32

    I didn't create a custom UIDataDetectorTypes but Craig Hockenberry did something like it with his TwitterrificTouch.

    He uses regular expressions to detect links and other things. I provide it with my keywords and then they become tappable. He places buttons on top of the matching text from the underlying labels. You can google a lot of posts that talk about "putting transparent buttons on top" of various things but Craig's code is the only example/working code I could find.

    Here is the link: http://furbo.org/2008/10/07/fancy-uilabels/

提交回复
热议问题