title: Terminating app, reason: 'containerIdentifier can not be nil' terminating with uncaught exception of type CKException
body: <p>I'm new with Swift.
  And I have my first project with CloudKit.
  But unfortunately I get a error wit getting data from CloudKit:</p>
  <p>I get this error:</p>
  <pre><code>*** Terminating app due to uncaught exception 'CKException', reason: 'containerIdentifier can not be nil'
  terminating with uncaught exception of type CKException
  </code></pre>
  <p>With this code:</p>
  <pre><code>import Foundation
  import CloudKit
  
  class CKRelation {
      static let database = CKContainer.default().publicCloudDatabase
  
      class func fetch(completion: @escaping (Result&lt;[Relation], Error&gt;) -&gt; ()) {
          let predicate = NSPredicate(value: true)
          let name = NSSortDescriptor(key: &quot;LastName&quot;, ascending: true)
          let query = CKQuery(recordType: &quot;Clients&quot;, predicate: predicate)
          query.sortDescriptors = [name]
  
          let operation = CKQueryOperation(query: query)
          operation.desiredKeys = [&quot;FirstName&quot;, &quot;Initials&quot;, &quot;LastName&quot;, &quot;MiddleName&quot;, &quot;RelationId&quot;]
          operation.resultsLimit = 50
  
          var newRelations = [Relation]()
  
          operation.recordFetchedBlock = { record in
              var relation = Relation()
              relation.recordID = record.recordID
              relation.FirstName = record[&quot;FirstName&quot;] as! String
              relation.Initials = record[&quot;Initials&quot;] as! String
              relation.LastName = record[&quot;LastName&quot;] as! String
              relation.MiddleName = record[&quot;MiddleName&quot;] as! String
              relation.RelationId = record[&quot;RelationId&quot;] as! Int
              
              newRelations.append(relation)
          }
  
          operation.queryCompletionBlock = { (cursor, error) in
              DispatchQueue.main.async {
                  if let error = error {
                      completion(.failure(error))
                  } else {
                      completion(.success(newRelations))
                      print(&quot;data&quot;)
                  }
              }
          }
          database.add(operation)
      }
  </code></pre>
  <p>I can not find anything on the internet. Hopefully somebody can help me.</p>