     }
   }
   
-  func contactContainsText( cNContact: CNContact, searchText: String ) -> Bool {
-    let searchText   = searchText.lowercaseString;
-    let textToSearch = cNContact.givenName.lowercaseString + " " + cNContact.familyName.lowercaseString
-
-    if searchText.isEmpty || textToSearch.containsString(searchText) {
+  func contactContainsText( _ cNContact: CNContact, searchText: String ) -> Bool {
+    let searchText   = searchText.lowercased();
+    let textToSearch = cNContact.givenName.lowercased() + " " + cNContact.familyName.lowercased()
+
+    if searchText.isEmpty || textToSearch.contains(searchText) {
       return true
     }
     else {

        birthday["day"] = String(cNContact.birthday!.day)
      }

      contact["birthday"] = birthday

    }


    
  }
  
  @objc func deleteContact(_ identifier: String, callback: (NSObject) -> () ) -> Void {
    
    let contactStore = CNContactStore()
    
    let cNContact = getCNContact( identifier, keysToFetch: keysToFetch as [CNKeyDescriptor] )
    
    let saveRequest = CNSaveRequest()
    
    let mutableContact = cNContact!.mutableCopy() as! CNMutableContact
    
    saveRequest.delete(mutableContact)
    
    do {
      
      try contactStore.execute(saveRequest)
      
      callback( [NSNull(), true] )
      
