transformingAttributes(_:_:)
Returns an attributed string by calling a closure that transforms one attribute, which a key path identifies, of a source attributed string.
Declaration
@preconcurrency func transformingAttributes<K>(_ k: KeyPath<AttributeDynamicLookup, K>, _ c: (inout AttributedString.SingleAttributeTransformer<K>) -> Void) -> AttributedString where K : AttributedStringKey, K.Value : SendableParameters
- k:
The key path to the Attributedstringkey that identifies the attribute to transform.
- c:
The closure that receives an Singleattributetransformer that you use to access and alter the attribute’s range and value.
Return Value
An attributed string with the applied transformation to the specified attribute.
See Also
Transforming Attributes
transformingAttributes(_:_:)transformingAttributes(_:_:_:)transformingAttributes(_:_:_:)transformingAttributes(_:_:_:_:)transformingAttributes(_:_:_:_:)transformingAttributes(_:_:_:_:_:)transformingAttributes(_:_:_:_:_:)transformingAttributes(_:_:_:_:_:_:)transformingAttributes(_:_:_:_:_:_:)AttributedString.SingleAttributeTransformer