transform(updating:body:)
Tracks the location of the selection throughout the mutation closure, updating the selection so it represents the same effective locations after the mutation.
Declaration
mutating func transform<E>(updating selection: inout AttributedTextSelection, body: (inout AttributedString) throws(E) -> Void) throws(E) where E : ErrorParameters
- selection:
The selection to track throughout the
bodyclosure. - body:
A mutating operation, or set of operations, to perform on the value of
self. The value ofselfis provided to the closure as aninout AttributedStringthat the closure should mutate directly. Do not capture the value ofselfin the provided closure - the closure should mutate the providedinoutcopy.