title: Delete Contact address from mobile memory and firestore memory swift 5?
body: <p>I'm comparing database contact with local contact (if self-dbcontact-identifier == localcontact-identifier) and I have successfully done it but when I tried to compare databasecontact address with local contact (if self.addresses[sender.tag].contactId == contact.postalAddresses.identifier) I'm getting an error in localcontact-postaladdresses --identifier.</p>
  <pre><code>{
         print(&quot;Access granted&quot;)
         
         let keys = [CNContactGivenNameKey, CNContactFamilyNameKey, CNContactPhoneNumbersKey, CNContactPostalAddressesKey]
         let request = CNContactFetchRequest(keysToFetch: keys as [CNKeyDescriptor])
         
         do {
             try self.store.enumerateContacts(with: request, usingBlock: { (localcontact, stopPointerIfYouWantToStopEnumerating) in
                 
                 var contacts = CNMutableContact()
                 contacts = contact.mutableCopy() as! CNMutableContact
                 contacts.postalAddresses.append(CNLabeledValue(label: CNLabelHome, value: self.homeAddress))
                 
                 if self.dbcontact.identifier == localcontact.identifier {
  //getting error in below line contact.postaladdresses.identifier
  
                     if self.addresses[sender.tag].contactId == contact.postalAddresses.identifier {
                         
                     }
                  
                     do {
                         let saveRequest = CNSaveRequest()
                         saveRequest.delete(contacts)
                         let contactstore = CNContactStore()
                         try contactstore.execute(saveRequest)
  
                         self.navigationController?.popToRootViewController(animated: true)
                     
                     } catch let error {
                         print(&quot;could not be update due to \(error.localizedDescription)&quot;)
                     }
                 }
             })
             
         } catch let err {
             print(&quot;Failed to enumerate contacts:&quot;, err)
         }
         
     } else {
         print(&quot;Access denied..&quot;)
     }
  </code></pre>