---
title: style
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/personnamecomponents/formatstyle/style-swift.property
---

# style

Specifies the style of the formatted result.

## Declaration

```swift
var style: PersonNameComponents.FormatStyle.Style
```

## Discussion

Discussion The style property controls length of the string representation of the name. For example: var tlc = PersonNameComponents() tlc.familyName = "Clark" tlc.givenName = "Thomas" tlc.middleName = "Louis" tlc.namePrefix = "Dr." tlc.nickname = "Tom" tlc.nameSuffix = "Esq."

let longFormatStyle = PersonNameComponents.FormatStyle(style: .long, locale: Locale(identifier: "us_EN")) print(tlc.formatted(longFormatStyle)) // Dr. Thomas Louis Clark Esq.          let mediumFormatStyle = PersonNameComponents.FormatStyle(style: .medium, locale: Locale(identifier: "us_EN")) print(tlc.formatted(mediumFormatStyle)) // Thomas Clark          let shortFormatStyle = PersonNameComponents.FormatStyle(style: .short, locale: Locale(identifier: "us_EN")) print(tlc.formatted(shortFormatStyle)) // Tom          let abbrevFormatStyle = PersonNameComponents.FormatStyle(style: .abbreviated, locale: Locale(identifier: "us_EN")) print(tlc.formatted(abbrevFormatStyle)) // TC

let defaultFormatStyle = PersonNameComponents.FormatStyle(locale: Locale(identifier: "us_EN")) print(tlc.formatted(defaultFormatStyle)) // Thomas Clark The default value is medium. Styles You can configure PersonNameComponents.FormatStyle to format names in the following styles: The following table demonstrates the style for various names and locales.  |  |  |  |  |  |   |  |  |  |  |  |   |  |  |  |  |  |   |  |  |  |  |  |   |  |  |  |  |  |   |  |  |  |  |  |   |  |  |  |  |  |   |  |  |  |  |  |   |  |  |  |  |  |   |  |  |  |  |  |  Long The Long style provides the most explicit representation of names. It uses all available name components, with the exception of nickname.  |   |   |   |   |   |   |   |   |   |  Medium The Medium, or default, style presents names in a way that is suitable for most contexts. It uses the given and family names, as well as a nickname, if provided, and enabled by the user.  |   |   |   |   |   |   |   |   |   |  Short The Short style offers an alternative display method for names whose default representation may exceed a certain length constraint. Users customize how the system displays short names in the preferences for the Contacts app. For scripts that don’t support Short name, or cases where the specified Short style is unavailable, the format uses Medium style. The table below shows the formatted string output for each Short Name configuration and for a variety of locales:  |  |  |  |   |  |  |  |   |  |  |  |   |  |  |  |   |  |  |  |   |  |  |  |   |  |  |  |   |  |  |  |   |  |  |  |   |  |  |  |  important: PersonNameComponents.FormatStyle doesn’t account for prepositional particles. Representations using the Short style that specify a family name initial naively use the first letter unit of the particle as the initial. Abbreviated The Abbreviated style offers the most compact representation of names, similar to a monogram. Abbreviated style is supported for names in several scripts, with the following general characteristics: For names in Cyrillic, Greek, or Latin script, the first characters of givenName, middleName, and familyName may be used. For names in Chinese or Japanese script, familyName may be used. If familyName is too long, or if the family name is nil, the Short or Medium style may be used instead. For names in Korean script, givenName may be used. If givenName is too long, the first character of givenName may be used. If givenName is nil, the familyName may be used instead. For names in Bengali, Devanagari, Gujarati, Gurmukhi, Kannada, Malayalam, Oriya, Sinhala, Tamil, Telugu, Tibetan, or Thai script, the first character of givenName may be used. If givenName is nil, the first character of familyName may be used instead. For names that contain more than one script, the abbreviated style may use the familyName, givenName, or the first characters of givenName and/or familyName. If the Abbreviated style is unavailable, the Short style is used instead—unless that too is unsupported, in which case the Medium style is used instead.  |   |   |   |   |   |   |   |   |   |  important: PersonNameComponents.FormatStyle doesn’t account for prepositional particles or compound names. Representations using the Abbreviated style uses the first letter unit of each name component, regardless.

## See Also

### Modifying a Format Style

- [PersonNameComponents.FormatStyle.Style](foundation/personnamecomponents/formatstyle/style-swift.enum.md)
- [locale](foundation/personnamecomponents/formatstyle/locale.md)
- [attributed](foundation/personnamecomponents/formatstyle/attributed.md)
- [locale(_:)](foundation/personnamecomponents/formatstyle/locale(_:).md)
