Episode #478

Handling Links in Text

Series: Layout in Code

10 minutes
Published on February 11, 2021

This video is only available to subscribers. Get access to this video and 586 others.

Sometimes our text contains links that should be styled differently and react to taps so a URL can be opened in a web browser. While we can use a UILabel to detect and style links, they don't respond to touches. Let's see how we can leverage UITextView instead to handle links in NSAttribtedStrings.

This episode uses Swift 5.3, Xcode 12.4.