<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/AttributedString/AttributeMergePolicy",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation16AttributedStringV20AttributeMergePolicyO"
  },
  "title" : "AttributedString.AttributeMergePolicy"
}
-->

# AttributedString.AttributeMergePolicy

An enumeration of behaviors to apply when merging attributes.

```
enum AttributeMergePolicy
```

## Overview

Use an [`AttributedString.AttributeMergePolicy`](/documentation/Foundation/AttributedString/AttributeMergePolicy) when working with methods like [`mergeAttributes(_:mergePolicy:)`](/documentation/Foundation/AttributedString/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

[`case keepCurrent`](/documentation/Foundation/AttributedString/AttributeMergePolicy/keepCurrent)

A policy to keep the string’s current attribute value when merging multiple sets of attributes.

[`case keepNew`](/documentation/Foundation/AttributedString/AttributeMergePolicy/keepNew)

A policy to keep the newly-merged attribute value when merging multiple sets of attributes.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)