title: Deleting CloudKit Records Swift 4
body: <p>I am having issues deleting CloudKit records. This is my first time dealing with the API and apparently there are two ways to do this. </p>
  
  <p>Saving records is straight forward and ostensibly so is deleting them, except this doesn't do it:</p>
  
  <pre><code>func deleteRecords() {
  
      let recordID = record.recordID
      publicDatabase.delete(withRecordID: recordID) { (recordID, error) in
          guard let recordID = recordID else {
          print(error!.localizedDescription)
              return
      }
          print("Record \(recordID) was successfully deleted")
      }
  }
  </code></pre>
  
  <p>I understand using a <code>ckModifyRecordsOperation</code> is another way to do this but this is a batch operation. I only need to delete one record at a time. Here's my code for that:</p>
  
  <pre><code> func batchDelete() {
      let recordIDsToDelete = [CKRecordID]()
      let operation = CKModifyRecordsOperation(recordsToSave: nil, recordIDsToDelete: recordIDsToDelete)
      operation.modifyRecordsCompletionBlock = { savedRecords, deletedRecordIDs, error in
          // handle errors here
      }
      publicDatabase.add(operation)
      print("Batch \(recordIDsToDelete) record was successfully deleted")
  }
  </code></pre>
  
  <p>Neither of these separately or together are working for me.</p>