<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Formatter/Context",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSFormattingContext"
  },
  "title" : "Formatter.Context"
}
-->

# Formatter.Context

The formatting context for a formatter.

```
enum Context
```

## Overview

Use formatting contexts to specify where the result of formatting will appear, so that the formatter can provide the most appropriate result.

For example, when formatting a date or date symbol for a French locale, you want the month name to be capitalized if it appears at the beginning of the sentence (“Juin est mon mois de naissance”), but not if it appears elsewhere (“Mon mois de naissance est juin”).

If the formatting context isn’t known ahead of time, specify [`Formatter.Context.dynamic`](/documentation/Foundation/Formatter/Context/dynamic) to have the system determine the context automatically.

## Topics

### Constants

[`NSFormattingContextUnknown`](/documentation/Foundation/Formatter/Context/unknown)

An unknown formatting context.

[`NSFormattingContextDynamic`](/documentation/Foundation/Formatter/Context/dynamic)

A formatting context determined automatically at runtime.

[`NSFormattingContextStandalone`](/documentation/Foundation/Formatter/Context/standalone)

The formatting context for stand-alone usage.

[`NSFormattingContextListItem`](/documentation/Foundation/Formatter/Context/listItem)

The formatting context for a list or menu item.

[`NSFormattingContextBeginningOfSentence`](/documentation/Foundation/Formatter/Context/beginningOfSentence)

The formatting context for the beginning of a sentence.

[`NSFormattingContextMiddleOfSentence`](/documentation/Foundation/Formatter/Context/middleOfSentence)

The formatting context for the middle of a sentence.

## Relationships

### Conforms To

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

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

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

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

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

[`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)