Run

@dynamicMemberLookup
public struct Run

A Run represents a range of identical attributes in the attributed text.

You can access any properties of TextAttributeContainer on this type using dynamic member lookup.

  • The range of the run of attributes.

    Declaration

    Swift

    public let range: Range<String.Index>
  • The attributes that apply to this run.

    Note that you can access properties of the attribute container directly on the Run itself, since it implements dynamic member look up.

    Declaration

    Swift

    public let attributes: TextAttributeContainer
  • Dynamic member getter for the TextAttributeContainer of this run.

    Declaration

    Swift

    public subscript<Value>(dynamicMember keyPath: KeyPath<TextAttributeContainer, Value>) -> Value { get }