---
title: "name(style:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/parseableformatstyle/name(style:)"
---

# name(style:)

Returns a format style to use the given name style for formatting a name from its components.

## Declaration

```swift
static func name(style: PersonNameComponents.FormatStyle.Style) -> Self
```

## Parameters

- `style`: A name-formatting style, such as doc://com.apple.foundation/documentation/Foundation/PersonNameComponents/FormatStyle/Style-swift.enum/long or doc://com.apple.foundation/documentation/Foundation/PersonNameComponents/FormatStyle/Style-swift.enum/abbreviated.

## Return Value

Return Value A name format style.

## Discussion

Discussion Use the dot-notation form of this type method when the call point allows the use of PersonNameComponents.FormatStyle. You typically do this when calling the formatted(_:) method of PersonNameComponents. The following example shows the effect of creating and using different person name format styles. let name = PersonNameComponents(namePrefix: "Dr.",                                 givenName: "Thomas",                                 middleName: "Louis",                                 familyName: "Clark",                                 nameSuffix: "Jr.",                                 nickname: "Tom") let longFormattedName = name.formatted(.name(style: .long)) // "Dr. Thomas Louis Clark Jr." let mediumFormattedName = name.formatted(.name(style: .medium)) // "Thomas Clark" let shortFormattedName = name.formatted(.name(style: .short)) // "Tom" let abbreviatedFormattedName = name.formatted(.name(style: .abbreviated)) // "TC"
