---
title: "setAttributes(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/attributedstring/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

### Applying and Modifying Attributes

- [mergeAttributes(_:mergePolicy:)](foundation/attributedstring/mergeattributes(_:mergepolicy:).md)
- [AttributedString.AttributeMergePolicy](foundation/attributedstring/attributemergepolicy.md)
- [replaceAttributes(_:with:)](foundation/attributedstring/replaceattributes(_:with:).md)
- [AttributedStringAttributeMutation](foundation/attributedstringattributemutation.md)
