StructureFoundationEssentials
AttributedString.SingleAttributeTransformer
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
A type that transforms an attribute by altering its range or value, or by replacing it entirely.
@preconcurrency struct SingleAttributeTransformer<T> where T : AttributedStringKey, T.Value : Sendable
Overview
For simple transformations, the closure you provide to the transformingAttributes(…) methods of AttributedString can use this instance to change the attribute’s value. You can also use this instance to change the range of the string that the attribute applies to. To completely replace the attribute with an attribute of a different type, use replace(with:value:)-6bn0e.
Topics
Instance Properties
var range: Range<AttributedString.Index>The range of the attribute in the attributed string.var value: T.Value?The value of the attribute.
Instance Methods
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype