Detect a Tap on a Link in a UITextView

Vesper’s detail view is a UITextView. When the keyboard is down, URLs inside the UITextView are tappable.

I’d done just a little work with UITextView in the past. Though I’d seen UITextRange and UITextPosition in the headers, I had no idea how these things worked. So I figured it out.

I published the code as a gist. You can probably improve the code. If you do, let me know.

Still to do: figure out how to highlight the link on tap.

18 Jun 2013

Archive