I'm fetching some contact fields using CNContactStore
such as first name (CNContactGivenNameKey
) and last name (CNContactFamilyNameKey
) but I can't find the key for company.
let request = CNContactFetchRequest(keysToFetch: [
CNContactGivenNameKey as NSString,
CNContactFamilyNameKey as NSString,
])
request.sortOrder = .familyName
do {
let store = CNContactStore()
try store.enumerateContacts(with: request) { contact, stop in
// ...
}
} catch {
print(error)
}