AttributedTextKey

public protocol AttributedTextKey

Define AttributedText keys using this protocol. Keys must have an attribute name and an associated type for the attribute.

After defining a key, enable dynamic member access to it by extending TextAttributeContainer with a property for getting and setting setting the value. This property should generally be optional, since the text may not have that property defined.

  • Declaration

    Swift

    associatedtype Value : Equatable
  • Declaration

    Swift

    static var name: NSAttributedString.Key { get }