Function

ABAddressBookRequestAccessWithCompletion(_:_:)

Requests access to address book data from the user.

Declaration

func ABAddressBookRequestAccessWithCompletion(_ addressBook: ABAddressBook!, _ completion: ABAddressBookRequestAccessCompletionHandler!)

Parameters

addressBook

The address book in question.

completion

The completion handler, called once access has been granted or denied by the user.

Discussion

Use this function to request access to address book data. This call will not block while the user is being asked for access, allowing your app to continue running. Until access has been granted, any address book references your app has will not contain any data, and any attempt to modify data will fail with an error type of kABOperationNotPermittedByUserError. The user is only asked for permission the first time you request access. Later calls use the permission granted by the user.

The completion handler is called on an arbitrary queue. If your app uses an address book throughout the app, you are responsible for ensuring that all usage of that address book is dispatched to a single queue to ensure correct thread-safe operation.

See Also

Deprecated

func ABAddressBookCopyArrayOfAllGroups(ABAddressBook!) -> Unmanaged<CFArray>!

Returns an array with all the groups in an address book.

Deprecated
func ABAddressBookCopyArrayOfAllGroupsInSource(ABAddressBook!, ABRecord!) -> Unmanaged<CFArray>!

Returns an array of all groups from a particular source.

Deprecated
func ABAddressBookCopyArrayOfAllPeople(ABAddressBook!) -> Unmanaged<CFArray>!

Returns all the person records in an address book.

Deprecated
func ABAddressBookCopyArrayOfAllPeopleInSource(ABAddressBook!, ABRecord!) -> Unmanaged<CFArray>!

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

Deprecated
func ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering(ABAddressBook!, ABRecord!, ABPersonSortOrdering) -> Unmanaged<CFArray>!

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

Deprecated
func ABAddressBookCopyArrayOfAllSources(ABAddressBook!) -> Unmanaged<CFArray>!

Returns an array of all sources in the address book.

Deprecated
func ABAddressBookCopyLocalizedLabel(CFString!) -> Unmanaged<CFString>!

Returns a localized version of a record-property label.

Deprecated
func ABAddressBookCopyPeopleWithName(ABAddressBook!, CFString!) -> Unmanaged<CFArray>!

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.

Deprecated
func ABAddressBookCreate() -> Unmanaged<ABAddressBook>!

Creates a new address book object with data from the Address Book database.

Deprecated
func ABAddressBookCreateWithOptions(CFDictionary!, UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Unmanaged<ABAddressBook>!

Creates a new address book object with data from the Address Book database.

Deprecated
func ABAddressBookGetAuthorizationStatus() -> ABAuthorizationStatus

Returns the authorization status of your app for accessing address book data.

Deprecated
func ABAddressBookGetGroupCount(ABAddressBook!) -> CFIndex

Returns the number of groups in an address book.

Deprecated
func ABAddressBookGetPersonCount(ABAddressBook!) -> CFIndex

Returns the number of person records in an address book.

Deprecated
func ABAddressBookGetSourceWithRecordID(ABAddressBook!, ABRecordID) -> Unmanaged<ABRecord>!

Returns the source record with the given record ID.

Deprecated
func ABAddressBookHasUnsavedChanges(ABAddressBook!) -> Bool

Indicates whether an address book has changes that have not been saved to the Address Book database.

Deprecated
func ABAddressBookRegisterExternalChangeCallback(ABAddressBook!, ABExternalChangeCallback!, UnsafeMutableRawPointer!)

Registers a callback to receive notifications when the Address Book database is modified.

Deprecated
func ABAddressBookRevert(ABAddressBook!)

Discards unsaved changes in an address book.

Deprecated
func ABAddressBookSave(ABAddressBook!, UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Bool

Saves any unsaved changes to the Address Book database.

Deprecated
func ABGroupCopySource(ABRecord!) -> Unmanaged<ABRecord>!

Returns the source that the group is from.

Deprecated
func ABGroupCreateInSource(ABRecord!) -> Unmanaged<ABRecord>!

Creates a group in a particular source.

Deprecated
func ABMultiValueCopyArrayOfAllValues(ABMultiValue!) -> Unmanaged<CFArray>!

Returns an array with the values in a multivalue property.

Deprecated
func ABMultiValueGetCount(ABMultiValue!) -> CFIndex

Returns the number of values in a multivalue property.

Deprecated
func ABMultiValueGetFirstIndexOfValue(ABMultiValue!, CFTypeRef!) -> CFIndex

Returns the first location of a value in a multivalue property.

Deprecated
func ABMultiValueGetIdentifierAtIndex(ABMultiValue!, CFIndex) -> ABMultiValueIdentifier

Returns the identifier of a value in a multivalue property.

Deprecated
func ABMultiValueGetIndexForIdentifier(ABMultiValue!, ABMultiValueIdentifier) -> CFIndex

Returns the location (within a multivalue property) of a value with a given identifier.

Deprecated
func ABMultiValueGetPropertyType(ABMultiValue!) -> ABPropertyType

Returns the type of the values contained in a multivalue property.

Deprecated
func ABMultiValueReplaceLabelAtIndex(ABMutableMultiValue!, CFString!, CFIndex) -> Bool

Replaces a label in a multivalue property with another label.

Deprecated
func ABMultiValueReplaceValueAtIndex(ABMutableMultiValue!, CFTypeRef!, CFIndex) -> Bool

Replaces a value in a multivalue property with another value.

Deprecated
func ABPersonCopyArrayOfAllLinkedPeople(ABRecord!) -> Unmanaged<CFArray>!

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

Deprecated
func ABPersonCopyCompositeNameDelimiterForRecord(ABRecord!) -> Unmanaged<CFString>!

Returns the delimiter to use between name components.

Deprecated
func ABPersonCopyImageDataWithFormat(ABRecord!, ABPersonImageFormat) -> Unmanaged<CFData>!

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

Deprecated
func ABPersonCopyLocalizedPropertyName(ABPropertyID) -> Unmanaged<CFString>!

Returns the localized name of a person property

Deprecated
func ABPersonCopySource(ABRecord!) -> Unmanaged<ABRecord>!

Returns the source that the person record is from.

Deprecated
func ABPersonCreateInSource(ABRecord!) -> Unmanaged<ABRecord>!

Creates a new person record in a particular source.

Deprecated
func ABPersonCreatePeopleInSourceWithVCardRepresentation(ABRecord!, CFData!) -> Unmanaged<CFArray>!

Creates person records from the given vCard representation.

Deprecated
func ABPersonCreateVCardRepresentationWithPeople(CFArray!) -> Unmanaged<CFData>!

Returns the vCard representation of the given person records.

Deprecated
func ABPersonGetCompositeNameFormat() -> ABPersonCompositeNameFormat

Returns the person-name display format.

Deprecated
func ABPersonGetCompositeNameFormatForRecord(ABRecord!) -> ABPersonCompositeNameFormat

Returns the person-name display format to use for the given record.

Deprecated
func ABPersonGetSortOrdering() -> ABPersonSortOrdering

Returns the user’s sort-ordering preference for lists of persons.

Deprecated
func ABPersonGetTypeOfProperty(ABPropertyID) -> ABPropertyType

Returns the type of a person property.

Deprecated
func ABPersonHasImageData(ABRecord!) -> Bool

Indicates whether a person has a picture.

Deprecated
func ABRecordCopyCompositeName(ABRecord!) -> Unmanaged<CFString>!

Returns an appropriate, human-friendly name for the record.

Deprecated
func ABRecordGetRecordID(ABRecord!) -> ABRecordID

Returns the unique ID of a record.

Deprecated
func ABRecordGetRecordType(ABRecord!) -> ABRecordType

Returns the type of a record.

Deprecated