transformingAttributes(_:_:_:)
Returns an attributed string created by calling a closure that transforms two attributes, which key paths identify, of a source attributed string.
Declaration
@preconcurrency func transformingAttributes<K1, K2>(_ k: KeyPath<AttributeDynamicLookup, K1>, _ k2: KeyPath<AttributeDynamicLookup, K2>, _ c: (inout AttributedString.SingleAttributeTransformer<K1>, inout AttributedString.SingleAttributeTransformer<K2>) -> Void) -> AttributedString where K1 : AttributedStringKey, K2 : AttributedStringKey, K1.Value : Sendable, K2.Value : SendableParameters
- k:
The key path to an Attributedstringkey that identifies an attribute to transform.
- k2:
The key path to an Attributedstringkey that identifies a second attribute to transform.
- c:
A closure that receives two Singleattributetransformer instances that you use to access and alter the attributes’ ranges and values.
Return Value
An attributed string with the applied transformations to the specified attributes.
See Also
Transforming Attributes
transformingAttributes(_:_:)transformingAttributes(_:_:)transformingAttributes(_:_:_:)transformingAttributes(_:_:_:_:)transformingAttributes(_:_:_:_:)transformingAttributes(_:_:_:_:_:)transformingAttributes(_:_:_:_:_:)transformingAttributes(_:_:_:_:_:_:)transformingAttributes(_:_:_:_:_:_:)AttributedString.SingleAttributeTransformer