ContactsInterfaceProtocol

public protocol ContactsInterfaceProtocol

Define metohods required to interact with Contacts framework.

Seealso

ContactsHandler
  • This closure passes information about a complete asynchronous task.

    Depending on the outcome the error may be available, and the success flag changes its value.

    Declaration

    Swift

    typealias CompletionBlock = (Bool, Error?) -> Void
  • Adds all contacts to the CNContactStore.

    Declaration

    Swift

    func addAll(_ contacts: [CNMutableContact], completion: @escaping CompletionBlock)

    Parameters

    contacts

    List of contacts.

    completion

    Completion closure called after contacts were saved to the store.

  • Remove all contacts from the CNContactStore.

    Declaration

    Swift

    func removeAll(completion: @escaping CompletionBlock)

    Parameters

    completion

    Completion closure called after contacts were removed from the store.

  • Request access to the Contacts framework.

    Declaration

    Swift

    func requestAccess(completion: @escaping CompletionBlock)

    Parameters

    completion

    Completion closure.