title: Trying to return a Users individual CKRecord Information - Swift, Cloudkit
body: <p>My code works fine with fetching record and returning them to my UITableview but the problem is it returns all the records in the Type. I have made users by saving them to the cloud via <a href="https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestore" rel="nofollow noreferrer">NSUbiquitousKeyValueStore</a>. So every time the User logs in I want them to be able to see just their information (Fields in their <a href="https://developer.apple.com/documentation/cloudkit/ckrecord" rel="nofollow noreferrer">CKRecord</a>) in the UITableView. </p>
  
  <pre><code>func fetch () {
      if userLoad(){
          let query = CKQuery(recordType: "User", predicate: predicate)
          query.sortDescriptors = [NSSortDescriptor(key: "username", ascending: false)]
          query.sortDescriptors = [NSSortDescriptor(key: "type", ascending: false)]
          query.sortDescriptors = [NSSortDescriptor(key: "hours", ascending: false)]
          database.perform(query, inZoneWith: nil) { (results,error) in
              if error != nil {
                  print("Error" + error.debugDescription)
              } else {
                  for results2 in results!{
                      self.trucks.append(results2)
                  }
              }
              OperationQueue.main.addOperation({ () -&gt; Void in
                  self.TableView.reloadData()
                  self.TableView.isHidden = false
  
              })
              print(results!)
          }
      } else {
          print("no user currently available")
      }
  }
  
  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return trucks.count
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      if indexPath.row == 0 {
      }
  
      let cell = TableView.dequeueReusableCell(withIdentifier: "firstTableCell") as! FirstTableCell
  
      if userLoad() {
          let truck = trucks[indexPath.row]
          cell.usernameLabel?.text = truck.value(forKey: "username") as? String
          cell.typeLabel?.text = truck.value(forKey: "type") as? String
          cell.hoursLabel?.text = truck.value(forKey: "hours") as? String
          return cell
      } else {
          print("no user")
          return cell
      }
  }
  </code></pre>