iOS Developer Library

Developer

AddressBook Framework Reference ABPerson Reference

Options
Deployment Target:

On This Page
Language:

ABPerson Reference

Inherits From


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import AddressBook

Objective-C

@import AddressBook;

Person records are represented by instances of the ABRecordRef opaque type, whose record type is kABPersonType. Person records store information about a person, such as first name, last name, address, email, and phone number.

Person records don’t necessarily have to be stored in the Address Book database. You can use person records as a way to group contact information in memory and present it to the user through, for example, a person view controller (ABPersonViewController).

Functions

  • Creates a new person record in the default source.

    Declaration

    Swift

    func ABPersonCreate() -> Unmanaged<ABRecord>!

    Objective-C

    ABRecordRef ABPersonCreate ( void );

    Discussion

    To add the newly created person record to the Address Book database, use ABAddressBookAddRecord.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Creates a new person record in a particular source.

    Declaration

    Swift

    func ABPersonCreateInSource(_ source: ABRecord!) -> Unmanaged<ABRecord>!

    Objective-C

    ABRecordRef ABPersonCreateInSource ( ABRecordRef source );

    Parameters

    source

    The source to create the person record in.

    Return Value

    A new person record in the specified source.

    Discussion

    To add the newly created person record to the Address Book database, use ABAddressBookAddRecord.

    If source is NULL, the group is created in the default source.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 4.0 and later

  • Indicates how two person records get sorted.

    Declaration

    Swift

    func ABPersonComparePeopleByName(_ person1: ABRecord!, _ person2: ABRecord!, _ ordering: ABPersonSortOrdering) -> CFComparisonResult

    Objective-C

    CFComparisonResult ABPersonComparePeopleByName ( ABRecordRef person1, ABRecordRef person2, ABPersonSortOrdering ordering );

    Parameters

    person1

    The first person.

    person2

    The second person.

    ordering

    Indicates whether to sort by first name or by last name. See “Sort Order”.

    Return Value

    • kCFCompareLessThan when person1 goes before person2.

    • kCFCompareEqualTo when person1 and person2 have the same name.

    • kCFCompareGreaterThan when person1 goes after person2.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Returns the type of a person property.

    Declaration

    Swift

    func ABPersonGetTypeOfProperty(_ property: ABPropertyID) -> ABPropertyType

    Objective-C

    ABPropertyType ABPersonGetTypeOfProperty ( ABPropertyID property );

    Parameters

    property

    The person property whose type is being returned.

    Return Value

    The type of property.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Returns the localized name of a person property

    Declaration

    Swift

    func ABPersonCopyLocalizedPropertyName(_ property: ABPropertyID) -> Unmanaged<CFString>!

    Objective-C

    CFStringRef ABPersonCopyLocalizedPropertyName ( ABPropertyID property );

    Parameters

    property

    The person property whose localized name is being returned.

    Return Value

    The localized name of property.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Sets a person’s picture.

    Declaration

    Swift

    func ABPersonSetImageData(_ person: ABRecord!, _ imageData: CFData!, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>) -> Bool

    Objective-C

    bool ABPersonSetImageData ( ABRecordRef person, CFDataRef imageData, CFErrorRef *error );

    Parameters

    person

    The person record whose picture is being set.

    imageData

    The picture to assign to person.

    error

    On error, information about the cause.

    Return Value

    true when successful, false otherwise.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Returns the picture for a person record.

    Declaration

    Swift

    func ABPersonCopyImageData(_ person: ABRecord!) -> Unmanaged<CFData>!

    Objective-C

    CFDataRef ABPersonCopyImageData ( ABRecordRef person );

    Parameters

    person

    The person record whose picture is being returned.

    Return Value

    The picture for person, or NULL if the person has no picture.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Returns the picture for a person record in the given format.

    Declaration

    Swift

    func ABPersonCopyImageDataWithFormat(_ person: ABRecord!, _ format: ABPersonImageFormat) -> Unmanaged<CFData>!

    Objective-C

    CFDataRef ABPersonCopyImageDataWithFormat ( ABRecordRef person, ABPersonImageFormat format );

    Parameters

    person

    The person record whose picture is being returned.

    format

    The size and shape being returned. See “Image Format”.

    Return Value

    The picture for person, or NULL if the person has no picture.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 4.1 and later

  • Indicates whether a person has a picture.

    Declaration

    Swift

    func ABPersonHasImageData(_ person: ABRecord!) -> Bool

    Objective-C

    bool ABPersonHasImageData ( ABRecordRef person );

    Parameters

    person

    The person record in question.

    Return Value

    true when person has a picture, false otherwise.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Removes a person’s picture.

    Declaration

    Swift

    func ABPersonRemoveImageData(_ person: ABRecord!, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>) -> Bool

    Objective-C

    bool ABPersonRemoveImageData ( ABRecordRef person, CFErrorRef *error );

    Parameters

    person

    The person record whose picture is being removed.

    error

    On error, information about the cause.

    Return Value

    true when successful, false otherwise.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Returns the number of person records in an address book.

    Declaration

    Swift

    func ABAddressBookGetPersonCount(_ addressBook: ABAddressBook!) -> CFIndex

    Objective-C

    CFIndex ABAddressBookGetPersonCount ( ABAddressBookRef addressBook );

    Parameters

    addressBook

    The address book whose person records are being counted.

    Return Value

    The number of person records in addressBook.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Returns the person record with a given record ID.

    Declaration

    Swift

    func ABAddressBookGetPersonWithRecordID(_ addressBook: ABAddressBook!, _ recordID: ABRecordID) -> Unmanaged<ABRecord>!

    Objective-C

    ABRecordRef ABAddressBookGetPersonWithRecordID ( ABAddressBookRef addressBook, ABRecordID recordID );

    Parameters

    addressBook

    The address book in which to search for recordID.

    recordID

    The record identifier to seek in addressBook.

    Return Value

    If found, the person record with recordID as its identifier, otherwise NULL.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Returns all the person records in an address book.

    Declaration

    Swift

    func ABAddressBookCopyArrayOfAllPeople(_ addressBook: ABAddressBook!) -> Unmanaged<CFArray>!

    Objective-C

    CFArrayRef ABAddressBookCopyArrayOfAllPeople ( ABAddressBookRef addressBook );

    Parameters

    addressBook

    The address book whose person records are being returned.

    Return Value

    Array containing the person records in addressBook.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Returns an array of all person records from a particular source.

    Declaration

    Swift

    func ABAddressBookCopyArrayOfAllPeopleInSource(_ addressBook: ABAddressBook!, _ source: ABRecord!) -> Unmanaged<CFArray>!

    Objective-C

    CFArrayRef ABAddressBookCopyArrayOfAllPeopleInSource ( ABAddressBookRef addressBook, ABRecordRef source );

    Parameters

    addressBook

    The address book whose records are being returned.

    source

    The source whose records are being returned.

    Return Value

    An array of all person records from a particular source.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 4.0 and later

  • Returns an array of all person records in the address book, sorted with the specified order.

    Declaration

    Swift

    func ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering(_ addressBook: ABAddressBook!, _ source: ABRecord!, _ sortOrdering: ABPersonSortOrdering) -> Unmanaged<CFArray>!

    Objective-C

    CFArrayRef ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering ( ABAddressBookRef addressBook, ABRecordRef source, ABPersonSortOrdering sortOrdering );

    Parameters

    addressBook

    The address book whose person records are being returned.

    source

    The source whose records are being returned.

    sortOrdering

    Indicates whether to sort by first name or by last name. See “Sort Order”.

    Return Value

    An array of all person records in the address book database, sorted by sortOrdering.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 4.0 and later

  • Performs a prefix search on the composite names of people in an address book and returns an array of persons that match the search criteria.

    Declaration

    Swift

    func ABAddressBookCopyPeopleWithName(_ addressBook: ABAddressBook!, _ name: CFString!) -> Unmanaged<CFArray>!

    Objective-C

    CFArrayRef ABAddressBookCopyPeopleWithName ( ABAddressBookRef addressBook, CFStringRef name );

    Parameters

    addressBook

    The address book in which to search.

    name

    The search term. Examples: "Mary", "Smi", "Hu Yan".

    Return Value

    Array containing person records (ABRecordRef objects) that match name.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Returns an array of all person records in the address book database that are linked to the given person record.

    Declaration

    Swift

    func ABPersonCopyArrayOfAllLinkedPeople(_ person: ABRecord!) -> Unmanaged<CFArray>!

    Objective-C

    CFArrayRef ABPersonCopyArrayOfAllLinkedPeople ( ABRecordRef person );

    Parameters

    person

    The person record whose linked records are being returned.

    Return Value

    An array of all person records in the address book database that are linked to the given person record

    Discussion

    Linked records contain information about the same person, and usually come from different sources.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 4.0 and later

  • Returns the source that the person record is from.

    Declaration

    Swift

    func ABPersonCopySource(_ person: ABRecord!) -> Unmanaged<ABRecord>!

    Objective-C

    ABRecordRef ABPersonCopySource ( ABRecordRef person );

    Parameters

    person

    The person whose source is being returned.

    Return Value

    The source of the person record.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 4.0 and later

  • Creates person records from the given vCard representation.

    Declaration

    Swift

    func ABPersonCreatePeopleInSourceWithVCardRepresentation(_ source: ABRecord!, _ vCardData: CFData!) -> Unmanaged<CFArray>!

    Objective-C

    CFArrayRef ABPersonCreatePeopleInSourceWithVCardRepresentation ( ABRecordRef source, CFDataRef vCardData );

    Parameters

    source

    The source in which to create the person record.

    vCardData

    The vCard data.

    Return Value

    The newly created person records.

    Discussion

    Address Book supports vCard version 3.0.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 5.0 and later

  • Returns the vCard representation of the given person records.

    Declaration

    Swift

    func ABPersonCreateVCardRepresentationWithPeople(_ people: CFArray!) -> Unmanaged<CFData>!

    Objective-C

    CFDataRef ABPersonCreateVCardRepresentationWithPeople ( CFArrayRef people );

    Parameters

    people

    An array of person records.

    Return Value

    The vCard representation of the records.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 5.0 and later

Data Types

  • Indicates a person sort ordering.

    Declaration

    Swift

    typealias ABPersonSortOrdering = UInt32

    Objective-C

    typedef uint32_t ABPersonSortOrdering;

    Discussion

    See “Sort Order”.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Indicates a person-name display format.

    Declaration

    Swift

    typealias ABPersonCompositeNameFormat = UInt32

    Objective-C

    typedef uint32_t ABPersonCompositeNameFormat;

    Discussion

    See “Composite Name Format”.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 2.0 and later

  • Indicates an image format.

    Declaration

    Swift

    struct ABPersonImageFormat { init(_ value: UInt32) var value: UInt32 }

    Objective-C

    typedef enum ABPersonImageFormat;

    Discussion

    See “Image Format”.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in iOS 4.1 and later

Constants

  • These constants identify sort order for person lists.

    Declaration

    Swift

    var kABPersonSortByFirstName: Int { get } var kABPersonSortByLastName: Int { get }

    Objective-C

    enum { kABPersonSortByFirstName = 0, kABPersonSortByLastName = 1 };

    Constants

    • kABPersonSortByFirstName

      kABPersonSortByFirstName

      Order by first name.

      Available in iOS 2.0 and later

    • kABPersonSortByLastName

      kABPersonSortByLastName

      Order by last name.

      Available in iOS 2.0 and later

  • These constants identify the format to use for a person’s composite name order for person records.

    Declaration

    Swift

    var kABPersonCompositeNameFormatFirstNameFirst: Int { get } var kABPersonCompositeNameFormatLastNameFirst: Int { get }

    Objective-C

    enum { kABPersonCompositeNameFormatFirstNameFirst = 0, kABPersonCompositeNameFormatLastNameFirst = 1 };

    Constants

    • kABPersonCompositeNameFormatFirstNameFirst

      kABPersonCompositeNameFormatFirstNameFirst

      First name first.

      Available in iOS 2.0 and later

    • kABPersonCompositeNameFormatLastNameFirst

      kABPersonCompositeNameFormatLastNameFirst

      Last name first.

      Available in iOS 2.0 and later

  • These constants identify the size and shape of images.

    Declaration

    Swift

    var kABPersonImageFormatThumbnail: ABPersonImageFormat { get } var kABPersonImageFormatOriginalSize: ABPersonImageFormat { get }

    Objective-C

    enum { kABPersonImageFormatThumbnail = 0, kABPersonImageFormatOriginalSize = 2 };

    Constants

    • kABPersonImageFormatThumbnail

      kABPersonImageFormatThumbnail

      The small square thumbnail.

      Available in iOS 4.1 and later

    • kABPersonImageFormatOriginalSize

      kABPersonImageFormatOriginalSize

      The image at its original size and shape.

      Available in iOS 4.1 and later

  • These constants identify person properties used to store personal information.

    Declaration

    Swift

    let kABPersonFirstNameProperty: ABPropertyID let kABPersonLastNameProperty: ABPropertyID let kABPersonMiddleNameProperty: ABPropertyID let kABPersonPrefixProperty: ABPropertyID let kABPersonSuffixProperty: ABPropertyID let kABPersonNicknameProperty: ABPropertyID let kABPersonFirstNamePhoneticProperty: ABPropertyID let kABPersonLastNamePhoneticProperty: ABPropertyID let kABPersonMiddleNamePhoneticProperty: ABPropertyID let kABPersonOrganizationProperty: ABPropertyID let kABPersonJobTitleProperty: ABPropertyID let kABPersonDepartmentProperty: ABPropertyID let kABPersonEmailProperty: ABPropertyID let kABPersonBirthdayProperty: ABPropertyID let kABPersonNoteProperty: ABPropertyID let kABPersonCreationDateProperty: ABPropertyID let kABPersonModificationDateProperty: ABPropertyID

    Objective-C

    const ABPropertyID kABPersonFirstNameProperty; const ABPropertyID kABPersonLastNameProperty; const ABPropertyID kABPersonMiddleNameProperty; const ABPropertyID kABPersonPrefixProperty; const ABPropertyID kABPersonSuffixProperty; const ABPropertyID kABPersonNicknameProperty; const ABPropertyID kABPersonFirstNamePhoneticProperty; const ABPropertyID kABPersonLastNamePhoneticProperty; const ABPropertyID kABPersonMiddleNamePhoneticProperty; const ABPropertyID kABPersonOrganizationProperty; const ABPropertyID kABPersonJobTitleProperty; const ABPropertyID kABPersonDepartmentProperty; const ABPropertyID kABPersonEmailProperty; const ABPropertyID kABPersonBirthdayProperty; const ABPropertyID kABPersonNoteProperty; const ABPropertyID kABPersonCreationDateProperty; const ABPropertyID kABPersonModificationDateProperty;

    Constants

    • kABPersonFirstNameProperty

      kABPersonFirstNameProperty

      First name. Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonLastNameProperty

      kABPersonLastNameProperty

      Last name. Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonMiddleNameProperty

      kABPersonMiddleNameProperty

      Middle name. Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonPrefixProperty

      kABPersonPrefixProperty

      Prefix (“Sir,” “Duke,” “General”). Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonSuffixProperty

      kABPersonSuffixProperty

      Suffix (“Jr.,” “Sr.,” “III”). Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonNicknameProperty

      kABPersonNicknameProperty

      Nickname. Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonFirstNamePhoneticProperty

      kABPersonFirstNamePhoneticProperty

      First name phonetic. Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonLastNamePhoneticProperty

      kABPersonLastNamePhoneticProperty

      Last name phonetic. Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonMiddleNamePhoneticProperty

      kABPersonMiddleNamePhoneticProperty

      Middle name phonetic. Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonOrganizationProperty

      kABPersonOrganizationProperty

      Organization name. Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonJobTitleProperty

      kABPersonJobTitleProperty

      Job title. Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonDepartmentProperty

      kABPersonDepartmentProperty

      Department. Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonEmailProperty

      kABPersonEmailProperty

      Email address. Type: kABMultiStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonBirthdayProperty

      kABPersonBirthdayProperty

      Birthday. Type: kABDateTimePropertyType.

      Available in iOS 2.0 and later

    • kABPersonNoteProperty

      kABPersonNoteProperty

      Note. Type: kABStringPropertyType.

      Available in iOS 2.0 and later

    • kABPersonCreationDateProperty

      kABPersonCreationDateProperty

      Creation date. Type: kABDateTimePropertyType.

      Available in iOS 2.0 and later

    • kABPersonModificationDateProperty

      kABPersonModificationDateProperty

      Modification date. Type: kABDateTimePropertyType.

      Available in iOS 2.0 and later

  • These constants implement the person address property (a multivalue property of type kABMultiDictionaryPropertyType) and the labels used to identify each of the property’s values.

    Declaration

    Swift

    let kABPersonAddressProperty: ABPropertyID let kABPersonAddressStreetKey: CFString! let kABPersonAddressCityKey: CFString! let kABPersonAddressStateKey: CFString! let kABPersonAddressZIPKey: CFString! let kABPersonAddressCountryKey: CFString! let kABPersonAddressCountryCodeKey: CFString!

    Objective-C

    const ABPropertyID kABPersonAddressProperty; const CFStringRef kABPersonAddressStreetKey; const CFStringRef kABPersonAddressCityKey; const CFStringRef kABPersonAddressStateKey; const CFStringRef kABPersonAddressZIPKey; const CFStringRef kABPersonAddressCountryKey; const CFStringRef kABPersonAddressCountryCodeKey;

    Constants

    • kABPersonAddressProperty

      kABPersonAddressProperty

      Identifier for the address multivalue property.

      Available in iOS 2.0 and later

    • kABPersonAddressStreetKey

      kABPersonAddressStreetKey

      Street.

      Available in iOS 2.0 and later

    • kABPersonAddressCityKey

      kABPersonAddressCityKey

      City.

      Available in iOS 2.0 and later

    • kABPersonAddressStateKey

      kABPersonAddressStateKey

      State.

      Available in iOS 2.0 and later

    • kABPersonAddressZIPKey

      kABPersonAddressZIPKey

      Zip code.

      Available in iOS 2.0 and later

    • kABPersonAddressCountryKey

      kABPersonAddressCountryKey

      Country.

      Available in iOS 2.0 and later

    • kABPersonAddressCountryCodeKey

      kABPersonAddressCountryCodeKey

      Country code. The value is an ISO country code.

      Available in iOS 2.0 and later

  • These constants implement the person dates property (a multivalue property of type kABMultiDateTimePropertyType) and the labels used to identify each of the property’s values.

    Declaration

    Swift

    let kABPersonDateProperty: ABPropertyID let kABPersonAnniversaryLabel: CFString!

    Objective-C

    const ABPropertyID kABPersonDateProperty; const CFStringRef kABPersonAnniversaryLabel;

    Constants

    • kABPersonDateProperty

      kABPersonDateProperty

      Identifier for the dates multivalue property.

      Available in iOS 2.0 and later

    • kABPersonAnniversaryLabel

      kABPersonAnniversaryLabel

      Birthdate.

      Available in iOS 2.0 and later

  • These constants implement the person type property (a property of type kABIntegerPropertyType), which indicates whether a person record represents a human being or an organization.

    Declaration

    Swift

    let kABPersonKindProperty: ABPropertyID let kABPersonKindPerson: CFNumber! let kABPersonKindOrganization: CFNumber!

    Objective-C

    const ABPropertyID kABPersonKindProperty; const CFNumberRef kABPersonKindPerson; const CFNumberRef kABPersonKindOrganization;

    Constants

    • kABPersonKindProperty

      kABPersonKindProperty

      Identifier for the type property.

      Available in iOS 2.0 and later

    • kABPersonKindPerson

      kABPersonKindPerson

      Identifies a person.

      Available in iOS 2.0 and later

    • kABPersonKindOrganization

      kABPersonKindOrganization

      Identifies an organization.

      Available in iOS 2.0 and later

  • These constants implement the person phone number property (a multivalue property of type kABMultiStringPropertyType) and the labels used to identify each of the property’s values.

    Declaration

    Swift

    let kABPersonPhoneProperty: ABPropertyID let kABPersonPhoneMobileLabel: CFString! let kABPersonPhoneIPhoneLabel: CFString! let kABPersonPhoneMainLabel: CFString! let kABPersonPhoneHomeFAXLabel: CFString! let kABPersonPhoneWorkFAXLabel: CFString! let kABPersonPhoneOtherFAXLabel: CFString! let kABPersonPhonePagerLabel: CFString!

    Objective-C

    const ABPropertyID kABPersonPhoneProperty; const CFStringRef kABPersonPhoneMobileLabel; const CFStringRef kABPersonPhoneIPhoneLabel; const CFStringRef kABPersonPhoneMainLabel; const CFStringRef kABPersonPhoneHomeFAXLabel; const CFStringRef kABPersonPhoneWorkFAXLabel; const CFStringRef kABPersonPhoneOtherFAXLabel; const CFStringRef kABPersonPhonePagerLabel;

    Constants

    • kABPersonPhoneProperty

      kABPersonPhoneProperty

      Identifier for the phone number multivalue property.

      Available in iOS 2.0 and later

    • kABPersonPhoneMobileLabel

      kABPersonPhoneMobileLabel

      Mobile phone number.

      Available in iOS 2.0 and later

    • kABPersonPhoneIPhoneLabel

      kABPersonPhoneIPhoneLabel

      iPhone number.

      Available in iOS 3.0 and later

    • kABPersonPhoneMainLabel

      kABPersonPhoneMainLabel

      Main phone number.

      Available in iOS 2.0 and later

    • kABPersonPhoneHomeFAXLabel

      kABPersonPhoneHomeFAXLabel

      Home fax number.

      Available in iOS 2.0 and later

    • kABPersonPhoneWorkFAXLabel

      kABPersonPhoneWorkFAXLabel

      Work fax number.

      Available in iOS 2.0 and later

    • kABPersonPhoneOtherFAXLabel

      kABPersonPhoneOtherFAXLabel

      Other fax number.

      Available in iOS 5.0 and later

    • kABPersonPhonePagerLabel

      kABPersonPhonePagerLabel

      Pager phone number.

      Available in iOS 2.0 and later

  • The keys used to specify the different fields in a kABPersonInstantMessageProperty property (a multivalue property of type kABMultiDictionaryPropertyType). Neither developers nor users can add more keys.

    Declaration

    Swift

    let kABPersonInstantMessageProperty: ABPropertyID let kABPersonInstantMessageServiceKey: CFString! let kABPersonInstantMessageUsernameKey: CFString!

    Objective-C

    const ABPropertyID kABPersonInstantMessageProperty; const CFStringRef kABPersonInstantMessageServiceKey; const CFStringRef kABPersonInstantMessageUsernameKey;

    Constants

    • kABPersonInstantMessageProperty

      kABPersonInstantMessageProperty

      Identifier for the instant message multivalue property.

      Available in iOS 2.0 and later

    • kABPersonInstantMessageServiceKey

      kABPersonInstantMessageServiceKey

      Instant message service.

      Available in iOS 2.0 and later

    • kABPersonInstantMessageUsernameKey

      kABPersonInstantMessageUsernameKey

      Instant message service username.

      Available in iOS 2.0 and later

  • The predefined constants are used to identify instant messaging services. You may use these constants or any other string.

    Declaration

    Swift

    let kABPersonInstantMessageServiceYahoo: CFString! let kABPersonInstantMessageServiceJabber: CFString! let kABPersonInstantMessageServiceMSN: CFString! let kABPersonInstantMessageServiceICQ: CFString! let kABPersonInstantMessageServiceAIM: CFString! let kABPersonInstantMessageServiceQQ: CFString! let kABPersonInstantMessageServiceGoogleTalk: CFString! let kABPersonInstantMessageServiceSkype: CFString! let kABPersonInstantMessageServiceFacebook: CFString! let kABPersonInstantMessageServiceGaduGadu: CFString!

    Objective-C

    const CFStringRef kABPersonInstantMessageServiceYahoo; const CFStringRef kABPersonInstantMessageServiceJabber; const CFStringRef kABPersonInstantMessageServiceMSN; const CFStringRef kABPersonInstantMessageServiceICQ; const CFStringRef kABPersonInstantMessageServiceAIM; const CFStringRef kABPersonInstantMessageServiceQQ; const CFStringRef kABPersonInstantMessageServiceGoogleTalk; const CFStringRef kABPersonInstantMessageServiceSkype; const CFStringRef kABPersonInstantMessageServiceFacebook; const CFStringRef kABPersonInstantMessageServiceGaduGadu;

    Constants

    • kABPersonInstantMessageServiceYahoo

      kABPersonInstantMessageServiceYahoo

      Yahoo instant message service.

      Available in iOS 2.0 and later

    • kABPersonInstantMessageServiceJabber

      kABPersonInstantMessageServiceJabber

      Jabber instant message service.

      Available in iOS 2.0 and later

    • kABPersonInstantMessageServiceMSN

      kABPersonInstantMessageServiceMSN

      MSN instant message service.

      Available in iOS 2.0 and later

    • kABPersonInstantMessageServiceICQ

      kABPersonInstantMessageServiceICQ

      ICQ instant message service.

      Available in iOS 2.0 and later

    • kABPersonInstantMessageServiceAIM

      kABPersonInstantMessageServiceAIM

      AIM instant message service.

      Available in iOS 2.0 and later

    • kABPersonInstantMessageServiceQQ

      kABPersonInstantMessageServiceQQ

      QQ instant message service.

      Available in iOS 5.0 and later

    • kABPersonInstantMessageServiceGoogleTalk

      kABPersonInstantMessageServiceGoogleTalk

      Google Talk instant message service.

      Available in iOS 5.0 and later

    • kABPersonInstantMessageServiceSkype

      kABPersonInstantMessageServiceSkype

      Skype instant message service.

      Available in iOS 5.0 and later

    • kABPersonInstantMessageServiceFacebook

      kABPersonInstantMessageServiceFacebook

      Facebook instant message service.

      Available in iOS 5.0 and later

    • kABPersonInstantMessageServiceGaduGadu

      kABPersonInstantMessageServiceGaduGadu

      Gadu-Gadu instant message service.

      Available in iOS 5.0 and later

  • The keys used to specify the different fields in a kABPersonSocialProfileProperty property (a multivalue property of type kABMultiDictionaryPropertyType). Neither developers nor users can add more keys.

    Declaration

    Swift

    let kABPersonSocialProfileProperty: ABPropertyID let kABPersonSocialProfileURLKey: CFString! let kABPersonSocialProfileServiceKey: CFString! let kABPersonSocialProfileUsernameKey: CFString! let kABPersonSocialProfileUserIdentifierKey: CFString!

    Objective-C

    const ABPropertyID kABPersonSocialProfileProperty; const CFStringRef kABPersonSocialProfileURLKey; const CFStringRef kABPersonSocialProfileServiceKey; const CFStringRef kABPersonSocialProfileUsernameKey; const CFStringRef kABPersonSocialProfileUserIdentifierKey;

    Constants

    • kABPersonSocialProfileProperty

      kABPersonSocialProfileProperty

      Identifier for the social profile property.

      Available in iOS 5.0 and later

    • kABPersonSocialProfileURLKey

      kABPersonSocialProfileURLKey

      Social profile URL.

      Available in iOS 5.0 and later

    • kABPersonSocialProfileServiceKey

      kABPersonSocialProfileServiceKey

      Social profile service.

      Available in iOS 5.0 and later

    • kABPersonSocialProfileUsernameKey

      kABPersonSocialProfileUsernameKey

      Social profile username.

      Available in iOS 5.0 and later

    • kABPersonSocialProfileUserIdentifierKey

      kABPersonSocialProfileUserIdentifierKey

      Social profile user identifier.

      Available in iOS 5.0 and later

  • The predefined constants are used to identify social networking services. You may use these constants or any other string.

    Declaration

    Swift

    let kABPersonSocialProfileServiceTwitter: CFString! let kABPersonSocialProfileServiceGameCenter: CFString! let kABPersonSocialProfileServiceSinaWeibo: CFString! let kABPersonSocialProfileServiceFacebook: CFString! let kABPersonSocialProfileServiceMyspace: CFString! let kABPersonSocialProfileServiceLinkedIn: CFString! let kABPersonSocialProfileServiceFlickr: CFString!

    Objective-C

    const CFStringRef kABPersonSocialProfileServiceTwitter; const CFStringRef kABPersonSocialProfileServiceSinaWeibo; const CFStringRef kABPersonSocialProfileServiceGameCenter; const CFStringRef kABPersonSocialProfileServiceFacebook; const CFStringRef kABPersonSocialProfileServiceMyspace; const CFStringRef kABPersonSocialProfileServiceLinkedIn; const CFStringRef kABPersonSocialProfileServiceFlickr;

    Constants

    • kABPersonSocialProfileServiceTwitter

      kABPersonSocialProfileServiceTwitter

      Twitter social profile service.

      Available in iOS 5.0 and later

    • kABPersonSocialProfileServiceGameCenter

      kABPersonSocialProfileServiceGameCenter

      Game Center social profile service.

      Available in iOS 5.0 and later

    • kABPersonSocialProfileServiceSinaWeibo

      kABPersonSocialProfileServiceSinaWeibo

      Sina Weibo social profile service.

      Available in iOS 6.0 and later

    • kABPersonSocialProfileServiceFacebook

      kABPersonSocialProfileServiceFacebook

      Facebook social profile service.

      Available in iOS 5.0 and later

    • kABPersonSocialProfileServiceMyspace

      kABPersonSocialProfileServiceMyspace

      Myspace social profile service.

      Available in iOS 5.0 and later

    • kABPersonSocialProfileServiceLinkedIn

      kABPersonSocialProfileServiceLinkedIn

      LinkedIn social profile service.

      Available in iOS 5.0 and later

    • kABPersonSocialProfileServiceFlickr

      kABPersonSocialProfileServiceFlickr

      Flickr social profile service.

      Available in iOS 5.0 and later

  • This constant implements the person URL property (a multivalue property of type kABMultiStringPropertyType) and the label used to identify the property’s sole value.

    Declaration

    Swift

    let kABPersonURLProperty: ABPropertyID let kABPersonHomePageLabel: CFString!

    Objective-C

    const ABPropertyID kABPersonURLProperty; const CFStringRef kABPersonHomePageLabel;

    Constants

    • kABPersonURLProperty

      kABPersonURLProperty

      Identifier for the URL multivalue property.

      Available in iOS 2.0 and later

    • kABPersonHomePageLabel

      kABPersonHomePageLabel

      Home page.

      Available in iOS 2.0 and later

  • These constants implement the person related name property (a multivalue property of type kABMultiStringPropertyType) and the labels used to identify each of the property’s values.

    Declaration

    Swift

    let kABPersonRelatedNamesProperty: ABPropertyID let kABPersonMotherLabel: CFString! let kABPersonFatherLabel: CFString! let kABPersonParentLabel: CFString! let kABPersonSisterLabel: CFString! let kABPersonBrotherLabel: CFString! let kABPersonChildLabel: CFString! let kABPersonFriendLabel: CFString! let kABPersonSpouseLabel: CFString! let kABPersonPartnerLabel: CFString! let kABPersonManagerLabel: CFString! let kABPersonAssistantLabel: CFString!

    Objective-C

    const ABPropertyID kABPersonRelatedNamesProperty; const CFStringRef kABPersonMotherLabel; const CFStringRef kABPersonFatherLabel; const CFStringRef kABPersonParentLabel; const CFStringRef kABPersonSisterLabel; const CFStringRef kABPersonBrotherLabel; const CFStringRef kABPersonChildLabel; const CFStringRef kABPersonFriendLabel; const CFStringRef kABPersonSpouseLabel; const CFStringRef kABPersonPartnerLabel; const CFStringRef kABPersonManagerLabel; const CFStringRef kABPersonAssistantLabel;

    Constants

    • kABPersonRelatedNamesProperty

      kABPersonRelatedNamesProperty

      Identifier for the related name multivalue property.

      Available in iOS 2.0 and later

    • kABPersonMotherLabel

      kABPersonMotherLabel

      Mother.

      Available in iOS 2.0 and later

    • kABPersonFatherLabel

      kABPersonFatherLabel

      Father.

      Available in iOS 2.0 and later

    • kABPersonParentLabel

      kABPersonParentLabel

      Parent.

      Available in iOS 2.0 and later

    • kABPersonSisterLabel

      kABPersonSisterLabel

      Sister.

      Available in iOS 2.0 and later

    • kABPersonBrotherLabel

      kABPersonBrotherLabel

      Brother.

      Available in iOS 2.0 and later

    • kABPersonChildLabel

      kABPersonChildLabel

      Child.

      Available in iOS 2.0 and later

    • kABPersonFriendLabel

      kABPersonFriendLabel

      Friend.

      Available in iOS 2.0 and later

    • kABPersonSpouseLabel

      kABPersonSpouseLabel

      Spouse.

      Available in iOS 2.0 and later

    • kABPersonPartnerLabel

      kABPersonPartnerLabel

      Partner.

      Available in iOS 2.0 and later

    • kABPersonManagerLabel

      kABPersonManagerLabel

      Manager.

      Available in iOS 2.0 and later

    • kABPersonAssistantLabel

      kABPersonAssistantLabel

      Assistant.

      Available in iOS 2.0 and later

  • These constants contain generic property labels.

    Declaration

    Swift

    let kABWorkLabel: CFString! let kABHomeLabel: CFString! let kABOtherLabel: CFString!

    Objective-C

    const CFStringRef kABWorkLabel; const CFStringRef kABHomeLabel; const CFStringRef kABOtherLabel;

    Constants

    • kABWorkLabel

      kABWorkLabel

      Work label.

      Available in iOS 2.0 and later

    • kABHomeLabel

      kABHomeLabel

      Home label.

      Available in iOS 2.0 and later

    • kABOtherLabel

      kABOtherLabel

      Other label.

      Available in iOS 2.0 and later

  • Alternate birthdays are represented by a new property whose value is a dictionary with specified keys, whose values are the relevant properties of an NSDateComponents object. The listed constants provide the reference to the property and the specified keys.

    Declaration

    Swift

    let kABPersonAlternateBirthdayProperty: ABPropertyID let kABPersonAlternateBirthdayCalendarIdentifierKey: CFString! let kABPersonAlternateBirthdayEraKey: CFString! let kABPersonAlternateBirthdayYearKey: CFString! let kABPersonAlternateBirthdayMonthKey: CFString! let kABPersonAlternateBirthdayIsLeapMonthKey: CFString! let kABPersonAlternateBirthdayDayKey: CFString!

    Objective-C

    const ABPropertyID kABPersonAlternateBirthdayProperty; const CFStringRef kABPersonAlternateBirthdayCalendarIdentifierKey; const CFStringRef kABPersonAlternateBirthdayEraKey; const CFStringRef kABPersonAlternateBirthdayYearKey; const CFStringRef kABPersonAlternateBirthdayMonthKey; const CFStringRef kABPersonAlternateBirthdayIsLeapMonthKey; const CFStringRef kABPersonAlternateBirthdayDayKey __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_8_0); // CFNumberRef - kCFNumberNSIntegerType

    Constants

    • kABPersonAlternateBirthdayProperty

      kABPersonAlternateBirthdayProperty

      The associated value is a kABDictionaryPropertyType with keys specified by the other constants listed here. You can use toll-free bridging to cast the value to NSDictionary. The data corresponds to an NSDateComponents object.

      Available in iOS 8.0 and later

    • kABPersonAlternateBirthdayCalendarIdentifierKey

      kABPersonAlternateBirthdayCalendarIdentifierKey

      The associated value is a string representing the calendar identifier for a CFCalendarRef. Corresponds to calendar.

      Available in iOS 8.0 and later

    • kABPersonAlternateBirthdayEraKey

      kABPersonAlternateBirthdayEraKey

      The associated value is a CFNumberRef of type kCFNumberNSIntegerType whose value is the era for the birthday. Corresponds to era.

      Available in iOS 8.0 and later

    • kABPersonAlternateBirthdayYearKey

      kABPersonAlternateBirthdayYearKey

      The associated value is a CFNumberRef of type kCFNumberNSIntegerType whose value is the year for the birthday. Corresponds to year.

      Available in iOS 8.0 and later

    • kABPersonAlternateBirthdayMonthKey

      kABPersonAlternateBirthdayMonthKey

      The associated value is a CFNumberRef of type kCFNumberNSIntegerType whose value is the month for the birthday. Corresponds to month.

      Available in iOS 8.0 and later

    • kABPersonAlternateBirthdayIsLeapMonthKey

      kABPersonAlternateBirthdayIsLeapMonthKey

      The associated value is a CFNumberRef of type kCFNumberCharType—used to represent a boolean—whose value is YEStrue if the birthday occurred during a leap month, NOfalse otherwise. Corresponds to isLeapMonth.

      Available in iOS 8.0 and later

    • kABPersonAlternateBirthdayDayKey

      kABPersonAlternateBirthdayDayKey

      The associated value is a CFNumberRef of type kCFNumberNSIntegerType whose value is the day for the birthday. Corresponds to day.

      Available in iOS 8.0 and later

    Discussion

    The alternate birthday property provides a way for a user to specify a birthday that differs from the specific birth date, or that only specifies certain components—for example, a month and a day, but no year. iOS and OS X make this property available for editing in the Contacts app.

    The alternate birthday property is not applicable to Exchange contacts.