QNAddressBooksRepository
public class QNAddressBooksRepository
Service to manage contact actions and subscribe to contact events
-
Sources from which the contacts will be fetched
- contacts
- phonebooks
- domain
- static
- groups
Declaration
Swift
public enum Source : String
-
Delegate for subscribing to contact events like new/remove contact
Declaration
Swift
public weak var delegate: QNAddressBooksDelegate?
-
Fetch all contacts filtered by source
Declaration
Swift
public func getContacts(using sources: [QNAddressBooksRepository.Source], fromCache: Bool = true, result: @escaping (Result<[QNContact], ResourceError>) -> Void)
Parameters
using
Sources from which the contacts will be fetched
fromCache
Retrieve from cache or server; true by default
result
Result with the list of Contacts
-
Add a new contact
Declaration
Swift
public func add(contact: QNContact, result: @escaping (Result<QNContact, ResourceError>) -> Void)
Parameters
contact
Contact to create
result
Result with new Contact
-
Update a contact
Declaration
Swift
public func update(contact: QNContact, result: @escaping (Result<QNContact, ResourceError>) -> Void)
Parameters
contact
Contact to update
result
Result with updated Contact
-
Remove a contact
Declaration
Swift
public func delete(contact: QNContact, result: @escaping (Result<Void, ResourceError>) -> Void)
Parameters
contact
Contact to remove