An immutable representation of a property that might have multiple values.


class ABMultiValue : NSObject


Each value in a multivalue list must be of the same type, and must have an associated predefined or user-defined label, and unique identifier. The labels, however, need not be unique. For example, you can have multiple Home phone numbers. Each multivalue object may have a primary identifier—used as a default value when a label is not provided. For example, a person record may have multiple addresses with the labels Home and Work, where Work is designated as the primary value. Instances of this class are immutable, see ABMutableMultiValue for methods that manipulate the content of a multivalue list.

The ABMultiValue class is “toll-free bridged” with its procedural C opaque-type counterpart. This means that the ABMultiValueRef type is interchangeable in function or method calls with instances of the ABMultiValue class.


Accessing the primary identifier

func primaryIdentifier() -> String!

Returns the identifier for the primary value.

Accessing identifiers

func identifier(at: Int) -> String!

Returns the identifier for the given index.

func index(forIdentifier: String!) -> Int

Returns the index for the given identifier.

Accessing entries

func label(at: Int) -> String!

Returns the label for the given index.

func value(at: Int) -> Any!

Returns the value for the given index.

func value(forIdentifier: String!) -> Any!

Returns the value for the given identifier.

func label(forIdentifier: String!) -> Any!

Returns the label for the given identifier.

Querying the list

func count() -> Int

Returns the number of entries in a multivalue list.

func propertyType() -> ABPropertyType

Returns the type for the values in a multivalue list.