Another one of those things is making the words clickable in a UILabel.  I’ve seen some very complex suggestions on how to do this voted up on Stackoverflow that will likely just waste a lot of time – so when i came across this component I thought it would be good share.

Here’s a video showing the control in action:

The library is GLTapLabel form German Lallon, and it works simply by calculating the frame size of the words, and turning each into a clickable area.

GLTapLabel is a drop-in replacement for UILabel and includes a delegate (GLTapLabelDelegate.h) and the class that you set as the delegate will receive callbacks including the word that has been tapped (an example is included).

You can find GLTapLabel and the example at the Github repo here.

The default behavior is for GLTapLabel to only make words beginning with the symbols “@” or “#” clickable so if you want to change that behavior like in the video look for the “BOOL hot” variable and remove it’s declaration and the associated if statement.

A nice solution to a common problem.