---
title: "callAsFunction(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiconfigurationtextattributestransformer-swift.struct/callasfunction(_:)"
---

# callAsFunction(_:)

Calls the transform closure of the text attributes transformer.

## Declaration

```swift
func callAsFunction(_ input: AttributeContainer) -> AttributeContainer
```

## Parameters

- `input`: The current attributes container for a string.

## Return Value

Return Value A new, transformed attributes container.

## Discussion

Discussion Using this syntax, you can call the text attributes transformer type as if it were a closure: var container = AttributeContainer() container.backgroundColor = UIColor.blue let transformer = UIConfigurationTextAttributesTransformer { incoming in     var outgoing = incoming     outgoing.backgroundColor = incoming.backgroundColor?.withAlphaComponent(0.6)     return outgoing } let transformed = transformer.callAsFunction(container)
