---
title: "init(style:locale:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/personnamecomponents/formatstyle/init(style:locale:)"
---

# init(style:locale:)

Creates an instance using the provided format style and locale.

## Declaration

```swift
init(style: PersonNameComponents.FormatStyle.Style = .medium, locale: Locale = .autoupdatingCurrent)
```

## Parameters

- `style`: The doc://com.apple.foundation/documentation/Foundation/PersonNameComponents/FormatStyle/Style-swift.enum used to format the name.
- `locale`: The doc://com.apple.foundation/documentation/Foundation/Locale used to create the string representation of the name.

## Discussion

Discussion Customize the person name components format style by providing a style and a locale. The formatted style can be long, medium, short, or abbreviated. The default value is PersonNameComponents.FormatStyle.Style.medium. The locale provides linguistic and cultural context to the formatted name. The default value is autoupdatingCurrent.
