Avoid using sync when dispatching to main queue (risk deadlock when entering foreground)

This commit is contained in:
QuentinArguillere 2024-09-09 17:18:05 +02:00
parent b2a7a11dba
commit 6478fbf03e

View file

@ -106,7 +106,7 @@ final class ContactsManager: ObservableObject {
do {
var contactCounter = 0
try store.enumerateContacts(with: request, usingBlock: { (contact, _) in
DispatchQueue.main.sync {
DispatchQueue.main.async {
let newContact = Contact(
identifier: contact.identifier,
firstName: contact.givenName,