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
usingSources from which the contacts will be fetched
fromCacheRetrieve from cache or server; true by default
resultResult with the list of Contacts
-
Add a new contact
Declaration
Swift
public func add(contact: QNContact, result: @escaping (Result<QNContact, ResourceError>) -> Void)Parameters
contactContact to create
resultResult with new Contact
-
Update a contact
Declaration
Swift
public func update(contact: QNContact, result: @escaping (Result<QNContact, ResourceError>) -> Void)Parameters
contactContact to update
resultResult with updated Contact
-
Remove a contact
Declaration
Swift
public func delete(contact: QNContact, result: @escaping (Result<Void, ResourceError>) -> Void)Parameters
contactContact to remove
QNAddressBooksRepository Class Reference