Contents

subscript(_:)

Returns a sequence which iterates of the values of a single attribute.

Declaration

subscript<K>(type: K.Type) -> some Sequence<Optional<K.Value>> where K : AttributedStringKey, K.Value : Sendable { get }

Overview

In the case of a range selection, the returned sequence is based on the runs of the specified attribute, not the runs over all attributes.

selection.attributes(in: text)[MyAttribute.self].contains(myValue)