This question already has an answer here:
My iOS application fetches contacts from device using code
[[CNContactStore new] requestAccessForEntityType:CNEntityTypeContacts completionHandler:^(BOOL granted, NSError *error) {
if (granted) {
NSArray *keys = @[CNContactNamePrefixKey,
CNContactGivenNameKey,
CNContactMiddleNameKey,
CNContactFamilyNameKey,
// ...
NSString *containerId = store.defaultContainerIdentifier;
NSPredicate *predicate = [CNContact predicateForContactsInContainerWithIdentifier:containerId];
NSArray *cnContacts = [store unifiedContactsMatchingPredicate:predicate keysToFetch:keys error:&error];
for (CNContact *contact in cnContacts) {
// contacts fetching
}
}
}];
Has CNContact class some value means that contact is in favorites on device (in Phone application)? I didn't found such key in CNContact keys.
Or maybe predicate contains keys that I needs?
Filip Radelic answered same question: