CreationKit Documentation

Extensions on NSAttributedString.Key

Properties

tappable

static let tappable: NSAttributedString.Key  

Marks that text is tappable. The value is a String that will be returned back to you in the tap handler.

This is only usable with CreationKit where it uses it's own TextView type. This will not work outside of any CreationKit types.

Usage:

let tappableText = NSAttributedString(
   string: "This text is tappable",
   attributes: [
     NSAttributedString.Key.font: FontManager.shared.caption,
     NSAttributedString.Key.foregroundColor: ColorManager.shared.messageCaptionText,
     NSAttributedString.Key.tappable: "tapTextKey"
   ]
 )