<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSAttributedString/EnumerationOptions",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSAttributedStringEnumerationOptions"
  },
  "title" : "NSAttributedString.EnumerationOptions"
}
-->

# NSAttributedString.EnumerationOptions

Options for enumerating attributes.

```
struct EnumerationOptions
```

## Overview

These constants describe the options available to the [`enumerateAttribute(_:in:options:using:)`](/documentation/Foundation/NSAttributedString/enumerateAttribute(_:in:options:using:)) and [`enumerateAttributes(in:options:using:)`](/documentation/Foundation/NSAttributedString/enumerateAttributes(in:options:using:)) methods.

## Topics

### Getting the enumeration options

[`NSAttributedStringEnumerationReverse`](/documentation/Foundation/NSAttributedString/EnumerationOptions/reverse)

Causes the enumeration to occur in reverse.

[`NSAttributedStringEnumerationLongestEffectiveRangeNotRequired`](/documentation/Foundation/NSAttributedString/EnumerationOptions/longestEffectiveRangeNotRequired)

If `NSAttributedStringEnumerationLongestEffectiveRangeNotRequired` option is supplied, then the longest effective range computation is not performed; the blocks may be invoked with consecutive attribute runs that have the same value.

### Creating an enumeration option

[`init(rawValue:)`](/documentation/Foundation/NSAttributedString/EnumerationOptions/init(rawValue:))

[`NSAttributedStringEnumerationReverse`](/documentation/Foundation/NSAttributedString/EnumerationOptions/reverse)

Causes the enumeration to occur in reverse.

[`NSAttributedStringEnumerationLongestEffectiveRangeNotRequired`](/documentation/Foundation/NSAttributedString/EnumerationOptions/longestEffectiveRangeNotRequired)

If `NSAttributedStringEnumerationLongestEffectiveRangeNotRequired` option is supplied, then the longest effective range computation is not performed; the blocks may be invoked with consecutive attribute runs that have the same value.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

---

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)