Create tap-able “links” in the NSAttributedString of a UILabel?

前端 未结 30 2597
半阙折子戏
半阙折子戏 2020-11-22 02:07

I have been searching this for hours but I\'ve failed. I probably don\'t even know what I should be looking for.

Many applications have text and in this text are web

30条回答
  •  清酒与你
    2020-11-22 02:56

    I'd strongly recommend using a library that automatically detects URLs in text and converts them to links. Try:

    • TTTAttributedLabel (pod)
    • ZSWTappableLabel (pod).

    Both are under MIT license.

提交回复
热议问题