One Logo Pool Ball
Foundation · IOS API REFERENCE

PersonNameComponents

struct · iOS 9.0+ · SDK 27.1

struct PersonNameComponents

The separate parts of a person's name, allowing locale-aware formatting.

Members (21)

get · iOS 9.0+

givenName

TypeScript
get givenName(): (string) | null
Swift declaration
var givenName: String? { get set }

Name bestowed upon an individual to differentiate them from other members of a group that share a family name. An example of a given name would be Maria.

set · iOS 9.0+

givenName

TypeScript
set givenName(value: (string) | null)
Swift declaration
var givenName: String? { get set }

Name bestowed upon an individual to differentiate them from other members of a group that share a family name. An example of a given name would be Maria.

get · iOS 9.0+

familyName

TypeScript
get familyName(): (string) | null
Swift declaration
var familyName: String? { get set }

Name bestowed upon an individual to denote membership in a group or family. An example of a family name would be Ruiz.

set · iOS 9.0+

familyName

TypeScript
set familyName(value: (string) | null)
Swift declaration
var familyName: String? { get set }

Name bestowed upon an individual to denote membership in a group or family. An example of a family name would be Ruiz.

get · iOS 9.0+

middleName

TypeScript
get middleName(): (string) | null
Swift declaration
var middleName: String? { get set }

Secondary name bestowed upon an individual to differentiate them from others that have the same given name. An example of a middle name would be Anne.

set · iOS 9.0+

middleName

TypeScript
set middleName(value: (string) | null)
Swift declaration
var middleName: String? { get set }

Secondary name bestowed upon an individual to differentiate them from others that have the same given name. An example of a middle name would be Anne.

init · iOS 15.0+

init

TypeScript
static initNamePrefixGivenNameMiddleNameFamilyNameNameSuffixNicknamePhoneticRepresentation(namePrefix?: (string) | null, givenName?: (string) | null, middleName?: (string) | null, familyName?: (string) | null, nameSuffix?: (string) | null, nickname?: (string) | null, phoneticRepresentation?: (PersonNameComponents) | null): PersonNameComponents
Swift declaration
init(namePrefix: String? = nil, givenName: String? = nil, middleName: String? = nil, familyName: String? = nil, nameSuffix: String? = nil, nickname: String? = nil, phoneticRepresentation: PersonNameComponents? = nil)
get · iOS 9.0+

namePrefix

TypeScript
get namePrefix(): (string) | null
Swift declaration
var namePrefix: String? { get set }

The portion of a name's full form of address that precedes the name itself. Some examples of name prefixes include Dr., Mr., and Ms.

set · iOS 9.0+

namePrefix

TypeScript
set namePrefix(value: (string) | null)
Swift declaration
var namePrefix: String? { get set }

The portion of a name's full form of address that precedes the name itself. Some examples of name prefixes include Dr., Mr., and Ms.

get · iOS 9.0+

nameSuffix

TypeScript
get nameSuffix(): (string) | null
Swift declaration
var nameSuffix: String? { get set }

The portion of a name's full form of address that follows the name itself. Examples of name suffixes include Esq., Jr., and Ph.D.

set · iOS 9.0+

nameSuffix

TypeScript
set nameSuffix(value: (string) | null)
Swift declaration
var nameSuffix: String? { get set }

The portion of a name's full form of address that follows the name itself. Examples of name suffixes include Esq., Jr., and Ph.D.

get · iOS 9.0+

description

TypeScript
get description(): string
Swift declaration
var description: String { get }

A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.

get · iOS 9.0+

customMirror

TypeScript
get customMirror(): SDKHandle
Swift declaration
var customMirror: Mirror { get }

The custom mirror for this instance. If this type has value semantics, the mirror should be unaffected by subsequent mutations of the instance.

get · iOS 9.0+

debugDescription

TypeScript
get debugDescription(): string
Swift declaration
var debugDescription: String { get }

A textual representation of this instance, suitable for debugging. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(reflecting:)` initializer. This initializer works with any type, and uses the custom `debugDescription` property for types that conform to `CustomDebugStringConvertible`: struct Point: CustomDebugStringConvertible { let x: Int, y: Int var debugDescription: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(reflecting: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `debugDescription` property.

get · iOS 9.0+

phoneticRepresentation

TypeScript
get phoneticRepresentation(): (PersonNameComponents) | null
Swift declaration
var phoneticRepresentation: PersonNameComponents? { get set }

The phonetic representation name components of the receiver.

set · iOS 9.0+

phoneticRepresentation

TypeScript
set phoneticRepresentation(value: (PersonNameComponents) | null)
Swift declaration
var phoneticRepresentation: PersonNameComponents? { get set }

The phonetic representation name components of the receiver.

get · iOS 9.0+

nickname

TypeScript
get nickname(): (string) | null
Swift declaration
var nickname: String? { get set }

Name substituted for the purposes of familiarity. An example of a nickname would be Bill.

set · iOS 9.0+

nickname

TypeScript
set nickname(value: (string) | null)
Swift declaration
var nickname: String? { get set }

Name substituted for the purposes of familiarity. An example of a nickname would be Bill.

method · iOS 15.0+

formatted

TypeScript
formatted(): string
Swift declaration
func formatted() -> String

Generates a locale-aware string representation of an instance of person name components using the default format style. - Returns: A string representation of the person name components.

init · iOS 9.0+

init

TypeScript
static init(): PersonNameComponents
Swift declaration
init()

Initializes a new person name components structure.

init · iOS 15.0+

init

TypeScript
static init86470(value: string): PersonNameComponents
Swift declaration
init(_ value: String) throws

Creates a person name components object from a given string. - Parameter value: The string to parse.

Skipped declarations

2 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

PersonNameComponents.formatted(_:)

This declaration needs Swift generic type arguments. (no canonical witness for S)

PersonNameComponents.init(_:strategy:)

This declaration needs Swift generic type arguments. (no canonical witness for S.ParseInput)

All Foundation types →