---
title: "transformingAttributes(_:_:_:_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/attributedstring/transformingattributes(_:_:_:_:)-4owv7"
---

# transformingAttributes(_:_:_:_:)

Returns an attributed string by calling a closure that transforms three attributes of a source attributed string.

## Declaration

```swift
@preconcurrency func transformingAttributes<K1, K2, K3>(_ k: K1.Type, _ k2: K2.Type, _ k3: K3.Type, _ c: (inout AttributedString.SingleAttributeTransformer<K1>, inout AttributedString.SingleAttributeTransformer<K2>, inout AttributedString.SingleAttributeTransformer<K3>) -> Void) -> AttributedString where K1 : AttributedStringKey, K2 : AttributedStringKey, K3 : AttributedStringKey, K1.Value : Sendable, K2.Value : Sendable, K3.Value : Sendable
```

## Parameters

- `k`: The doc://com.apple.foundation/documentation/Foundation/AttributedStringKey that identifies an attribute to transform.
- `k2`: The doc://com.apple.foundation/documentation/Foundation/AttributedStringKey that identifies a second attribute to transform.
- `k3`: The doc://com.apple.foundation/documentation/Foundation/AttributedStringKey that identifies a third attribute to transform.
- `c`: A closure that receives three doc://com.apple.foundation/documentation/Foundation/AttributedString/SingleAttributeTransformer instances that you use to access and alter the attributes’ ranges and values.

## Return Value

Return Value An attributed string with the applied transformations to the specified attributes.

## See Also

### Transforming Attributes

- [transformingAttributes(_:_:)](foundation/attributedstring/transformingattributes(_:_:)-9prm2.md)
- [transformingAttributes(_:_:)](foundation/attributedstring/transformingattributes(_:_:)-64qnl.md)
- [transformingAttributes(_:_:_:)](foundation/attributedstring/transformingattributes(_:_:_:)-7kw1o.md)
- [transformingAttributes(_:_:_:)](foundation/attributedstring/transformingattributes(_:_:_:)-8gt2n.md)
- [transformingAttributes(_:_:_:_:)](foundation/attributedstring/transformingattributes(_:_:_:_:)-5xmlf.md)
- [transformingAttributes(_:_:_:_:_:)](foundation/attributedstring/transformingattributes(_:_:_:_:_:)-9uodg.md)
- [transformingAttributes(_:_:_:_:_:)](foundation/attributedstring/transformingattributes(_:_:_:_:_:)-all0.md)
- [transformingAttributes(_:_:_:_:_:_:)](foundation/attributedstring/transformingattributes(_:_:_:_:_:_:)-3i7ac.md)
- [transformingAttributes(_:_:_:_:_:_:)](foundation/attributedstring/transformingattributes(_:_:_:_:_:_:)-9hppo.md)
- [AttributedString.SingleAttributeTransformer](foundation/attributedstring/singleattributetransformer.md)
