I am building an app in Swift. I would like to make predicate using a phoneNumber
(as String) and retrieve the name of that contact -if it exists- from the CNContactStore
. I can make a name predicate fairly easily by :
let pred = CNContact.predicateForContactsMatchingName(name: String)
But is there a way to do the same for a PhoneNumber
. I can of course fetch the entire CNContactStore
, loop through it and retrieve the contact. But I was wondering if there was any better way.