Specifies the FormatStyle applied to the person name components.
Return Value
戻り値
A string, formatted according to the provided style.
ある文字列、提供された形式により書式設定されます。
Discussion
議論
Use the formatted(_:) method to create a string representation of a person’s name with a customized length for specific uses. You can use the PersonNameComponents.FormatStyle static factory method name(style:) to create a custom format style as a parameter to the method.
For example:
例えば:
var tlc =PersonNameComponents()tlc.familyName ="Clark"tlc.givenName ="Thomas"tlc.middleName ="Louis"tlc.namePrefix ="Dr."tlc.nickname ="Tom"tlc.nameSuffix ="Esq."tlc.formatted(.name(style: .long))// Dr. Thomas Louis Clark Esq.tlc.formatted(.name(style: .medium))// Thomas Clarktlc.formatted(.name(style: .short))// Tomtlc.formatted(.name(style: .abbreviated))// TC