---
title: AttributedString.AttributeMergePolicy
framework: foundation
role: symbol
role_heading: Enumeration
path: foundation/attributedstring/attributemergepolicy
---

# AttributedString.AttributeMergePolicy

An enumeration of behaviors to apply when merging attributes.

## Declaration

```swift
enum AttributeMergePolicy
```

## Overview

Overview Use an AttributedString.AttributeMergePolicy when working with methods like mergeAttributes(_:mergePolicy:) to indicate how to resolve conflicts between multiple sets of attributes. When a source string and a merging attribute container both contain a given attribute with different values, the merge policy determines how to resolve the conflict.

## Topics

### Merge Policies

- [AttributedString.AttributeMergePolicy.keepCurrent](foundation/attributedstring/attributemergepolicy/keepcurrent.md)
- [AttributedString.AttributeMergePolicy.keepNew](foundation/attributedstring/attributemergepolicy/keepnew.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Applying and Modifying Attributes

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