---
title: "setAttributes(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/attributedstringattributemutation/setattributes(_:)"
---

# setAttributes(_:)

Sets the attributed string’s attributes to those in a specified attribute container.

## Declaration

```swift
mutating func setAttributes(_ attributes: AttributeContainer)
```

## Parameters

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

## See Also

### Mutating the String’s Attributes

- [mergeAttributes(_:mergePolicy:)](foundation/attributedstringattributemutation/mergeattributes(_:mergepolicy:).md)
- [replaceAttributes(_:with:)](foundation/attributedstringattributemutation/replaceattributes(_:with:).md)
