title: Custom Prototype Cell with Parse - Swift
body: <p>I'm building an app in which I want to show a couple of rows of data in parse.</p>
  
  <p>I want to have freedom when it comes to setting up the cell UI, therefore I followed <a href="https://medium.com/swift-programming/how-to-display-parse-com-images-in-a-table-view-ios-swift-parse-com-f73dd68adb5e" rel="nofollow">this tutorial</a>.</p>
  
  <p>I have a class CustomCell to link my labels and UIImage</p>
  
  <pre><code>import Foundation
  import UIKit
  import ParseUI
  
  class CustomCell:  PFTableViewCell {
  
  @IBOutlet weak var nomePrato: UILabel!
  @IBOutlet weak var precoPrato: UILabel!
  
  
  @IBOutlet weak var imagemPrato: PFImageView!
  
  
  }
  </code></pre>
  
  <p>And another class to set everything up</p>
  
  <pre><code>import UIKit
  import Parse
  import ParseUI
  
  class TableViewControllerPratos2: PFQueryTableViewController {
  
  
  
  // Initialise the PFQueryTable tableview
  override init(style: UITableViewStyle, className: String!) {
      super.init(style: style, className: className)
  }
  
  required init(coder aDecoder: NSCoder) {
      super.init(coder: aDecoder)
      // Configure the PFQueryTableView
      self.parseClassName = "ProdutosVenda"
      self.textKey = "Nome" 
      self.pullToRefreshEnabled = true
      self.paginationEnabled = false
  
  }
  
  
  // Define the query that will provide the data for the table view
  override func queryForTable() -&gt; PFQuery {
      var query = PFQuery(className: "ProdutosVenda")
      return query
  }
  
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject?) -&gt; PFTableViewCell {
  
      var cell = tableView.dequeueReusableCellWithIdentifier("Cell") as! CustomCell!
      if cell == nil {
          cell = CustomCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Cell")
      }
  
      // Extract values from the PFObject to display in the table cell
      if let nome = object?["Nome"] as? String {
          cell?.nomePrato.text = nome
      }
      if let preco = object?["Preco"] as? String {
          cell?.precoPrato.text = preco
      }
  
      // Display flag image
      var initialThumbnail = UIImage(named: "question")
      cell.imagemPrato.image = initialThumbnail
      if let thumbnail = object?["imagem1"] as? PFFile {
          cell.imagemPrato.file = thumbnail
          cell.imagemPrato.loadInBackground()
      }
  
      return cell
  }
      }
  </code></pre>
  
  <p>The outcome: no error, just a blank outline of the cells with no elements and a spinning loading animation.</p>