Hi I'm trying to filter my contact, all is well in the simulator xcode, but when I try it on my iPhone I have a problem with regular expression predicate. Any suggestions ?. Thank you very much.
func updateSearchResultsForSearchController(searchController: UISearchController) {
self.filteredContacs.removeAll(keepCapacity: false)
let searchPredcate = NSPredicate(format: "givenName contains[c] %@ OR familyName contains[c] %@",searchController.searchBar.text!)
let array = (self.contacts as NSArray).filteredArrayUsingPredicate(searchPredcate)
self.filteredContacs = array as! [CNContact]
self.tableViewContacts.reloadData()
}