问题
Questions:
How to get the last modified date in CNContact (new apple contacts framework) ?
The last modified date is not present in the list of keysToFetchI would like to fetch and update contacts that have been modified since my last fetch. How can I do this ?
回答1:
According to the Apple Staff reply, no api for that right now. https://forums.developer.apple.com/thread/16049
To perform nearly the same thing, I would suggest using
enumerateContactsWithFetchRequest:error:usingBlock:
Assuming an individual contact is identified by name, when the name field remain the same but other infos are changed, we can say the contact is updated. If you concern about the performance, do it on a background queue.
Hope this help.
回答2:
I have checked out CNContact framework for iOS 12, but I can't find API like kABPersonModificationDateProperty
https://developer.apple.com/documentation/contacts/cncontact?language=objc
来源:https://stackoverflow.com/questions/33193447/cncontact-last-modified-date-and-contacts-changed