<!--
{
  "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/dynamic",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSFormattingContext@NSFormattingContextDynamic"
  },
  "title" : "Formatter.Context.dynamic"
}
-->

# Formatter.Context.dynamic

A formatting context determined automatically at runtime.

```
case dynamic
```

## Discussion

A [`Formatter.Context.dynamic`](/documentation/Foundation/Formatter/Context/dynamic) context is automatically determined to be one of the following: [`Formatter.Context.standalone`](/documentation/Foundation/Formatter/Context/standalone), [`Formatter.Context.beginningOfSentence`](/documentation/Foundation/Formatter/Context/beginningOfSentence), or [`Formatter.Context.middleOfSentence`](/documentation/Foundation/Formatter/Context/middleOfSentence).

When used in combination with [`stringWithFormat:`](/documentation/Foundation/NSString/stringWithFormat:), the formatter returns a string proxy, formats the string using [`Formatter.Context.unknown`](/documentation/Foundation/Formatter/Context/unknown), determines context based on the proxy string’s location, and then reformats the string accordingly.

---

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)