<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/AttributedString/inflected(locale:userTermOfAddress:inflectionConcepts:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation16AttributedStringV9inflected6locale17userTermOfAddress18inflectionConceptsAcA6LocaleV_AA0ghI0VSgSayAA17InflectionConceptOGtF"
  },
  "title" : "inflected(locale:userTermOfAddress:inflectionConcepts:)"
}
-->

# inflected(locale:userTermOfAddress:inflectionConcepts:)

Process automatic grammar agreement and formatting attributes.

```
func inflected(locale: Locale = .current, userTermOfAddress: TermOfAddress? = .currentUser, inflectionConcepts: [InflectionConcept] = []) -> AttributedString
```

## Parameters

`locale`

The locale used for formatting the string. It also specifies
the language used for automatic grammar agreement, unless overridden
with the `languageIdentifier` attribute.

`userTermOfAddress`

The user’s preferred term of address, if the user
has set one. A value of `nil` indicates no preference, in which case
the inflection alternative will be used for strings that address the
the user. Default value is `.currentUser`.

`inflectionConcepts`

A list of objects providing additional hints for
automatic grammar agreement, such as terms of address for people who
are mentioned, or phrases with which the string has to grammatically
agree.

## Discussion

Arguments that were previously formatted in the string must be annotated
with the following attributes:

- `replacementIndex`, set to the index of the format specifier.
- `localizedNumericArgument`, if the argument was numeric, must also be
  set to the original value of the argument.
  If not all arguments are properly annotated, the `agreeWithArgument` and
  `inflect` attributes may not work properly and behavior is undefined.

---

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)