timonus / UILabelTapHandling

Make links in UILabels tappable.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UILabel+TJTapHandling

This category makes it so you can handle tapped hyperlinks in UILabels. The underlying way I'm doing this uses a strategy swirling around the internet that I've packaged up nicely. It seems to work pretty well, and the project layers on a pleasant API to use.

To configure link handling, call addURLHandler: on your label providing an object that conforms to TJLabelURLHandler. -label:didTapURL:inRange: will then be called on your handler when a link is tapped within that label's attributed text.

I'm currently using this in Opener's settings screen to add a link to a table section footer.

About

Make links in UILabels tappable.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Objective-C 100.0%