Merge branch 'charlesmchen/queueSystemContactFetch'

pull/1/head
Matthew Chen 8 years ago
commit dbbd35f923

@ -121,6 +121,9 @@ public enum ContactStoreAuthorizationStatus {
public class SystemContactsFetcher: NSObject { public class SystemContactsFetcher: NSObject {
private let TAG = "[SystemContactsFetcher]" private let TAG = "[SystemContactsFetcher]"
private let serialQueue = DispatchQueue(label: "SystemContactsFetcherQueue")
var lastContactUpdateHash: Int? var lastContactUpdateHash: Int?
var lastDelegateNotificationDate: Date? var lastDelegateNotificationDate: Date?
let contactStoreAdapter: ContactsFrameworkContactStoreAdaptee let contactStoreAdapter: ContactsFrameworkContactStoreAdaptee
@ -280,7 +283,7 @@ public class SystemContactsFetcher: NSObject {
systemContactsHaveBeenRequestedAtLeastOnce = true systemContactsHaveBeenRequestedAtLeastOnce = true
setupObservationIfNecessary() setupObservationIfNecessary()
DispatchQueue.global().async { serialQueue.async {
Logger.info("\(self.TAG) fetching contacts") Logger.info("\(self.TAG) fetching contacts")

Loading…
Cancel
Save