---
title: "settingAttributes(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/attributedstringprotocol/settingattributes(_:)"
---

# settingAttributes(_:)

Returns an attributed string by setting the attributed string’s attributes to those in a specified attribute container.

## Declaration

```swift
func settingAttributes(_ attributes: AttributeContainer) -> AttributedString
```

## Parameters

- `attributes`: The attribute container with the attributes to apply.

## Return Value

Return Value An attributed string from setting the attributed string’s attributes to those in a specified attribute container.

## See Also

### Applying Attributes

- [mergingAttributes(_:mergePolicy:)](foundation/attributedstringprotocol/mergingattributes(_:mergepolicy:).md)
- [AttributedString.AttributeMergePolicy](foundation/attributedstring/attributemergepolicy.md)
- [replacingAttributes(_:with:)](foundation/attributedstringprotocol/replacingattributes(_:with:).md)
