If the user decides to not allow access to their contact book, an error is never called.
Although if the app is closed and then reopened, the error is called successfully.
This is the code I am using:
self.addressBook.loadContacts { (contacts: [APContact]?, error: Error?) in
if let uwrappedContacts = contacts {
print(uwrappedContacts)
}
else if let unwrappedError = error {
print(unwrappedError)
}
}
As stated above, print(unwrappedError) is only ever called if the user has denied access to their contact book AFTER closing and opening the application.
If the user decides to not allow access to their contact book, an error is never called.
Although if the app is closed and then reopened, the error is called successfully.
This is the code I am using:
As stated above,
print(unwrappedError)
is only ever called if the user has denied access to their contact book AFTER closing and opening the application.