Structure

PersonNameComponents

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

Declaration

struct PersonNameComponents

Topics

Creating Person Name Components

init()

Initializes a new person name components structure.

Accessing Person Name Components

var namePrefix: String?

The portion of a name’s full form of address that precedes the name itself (for example, “Dr.,” “Mr.,” “Ms.”).

var givenName: String?

Name bestowed upon an individual to differentiate them from other members of a group that share a family name (for example, “Johnathan”).

var middleName: String?

Secondary name bestowed upon an individual to differentiate them from others that have the same given name (for example, “Maple”).

var familyName: String?

Name bestowed upon an individual to denote membership in a group or family. (for example, “Appleseed”).

var nameSuffix: String?

The portion of a name’s full form of address that follows the name itself (for example, “Esq.,” “Jr.,” “Ph.D.”).

var nickname: String?

Name substituted for the purposes of familiarity (for example, "Johnny").

var phoneticRepresentation: PersonNameComponents?

The phonetic representation name components of the receiver.

Comparing Person Name Components

static func != (PersonNameComponents, PersonNameComponents) -> Bool

Returns a Boolean value indicating whether two values are not equal.

static func == (PersonNameComponents, PersonNameComponents) -> Bool

Indicates whether two person name component structures are the same.

Describing Person Name Components

var description: String

A textual description of the structure.

var debugDescription: String

A textual description of the structure suitable for debugging.

var customMirror: Mirror

A mirror that reflects the date interval.

var hashValue: Int

The computed hash value for the date interval.

Using Reference Types

class NSPersonNameComponents

An object that manages the separate parts of a person's name that bridges to PersonNameComponents; use NSPersonNameComponents when you need reference semantics or other Foundation-specific behavior.

typealias PersonNameComponents.ReferenceType

An alias for this value type's equivalent reference type.

Instance Methods

See Also

Names

class PersonNameComponentsFormatter

A formatter that provides localized representations of the components of a person’s name.