func fetchContacts(){
let key = [CNContactGivenNameKey, CNContactPhoneNumbersKey] as [CNKeyDescriptor]
let request = CNContactFetchRequest(keysToFetch: key)
try! contactStore.enumerateContacts(with: request) { (contact, stoppingPointer) in
let name = contact.givenName
let number = contact.phoneNumbers.first?.value.stringValue
let contactToAppend = ContactStruct(name: name, number: number)
self.contacts.append(contactToAppend)
self.queryPhoneNumber()
}
tableView.reloadData()
}
In this way I'm getting contact numbers(with country code) and names of the contacts. How to get the contacts without country code.please help me in solving this problem. Thank you.