title: Custom UITableViewCell in swift
body: <p>I have an custom tableview cell in Swift as an xib file, which is fine and i have an swift file that links to it. </p>
  
  <p>like so : </p>
  
  <pre><code>import UIKit
  
  class CustomTableViewCell: UITableViewCell {
  
      @IBOutlet weak var CellTitle: UILabel!
      @IBOutlet weak var CellLocation: UILabel!
      @IBOutlet weak var CellDate: UILabel!
      @IBOutlet weak var Type: UIImageView!
      @IBOutlet weak var TypeText: UILabel!
  
  
  
      override func awakeFromNib() {
          super.awakeFromNib()
          // Initialization code
      }
  
      override func setSelected(selected: Bool, animated: Bool) {
          super.setSelected(selected, animated: animated)
  
          // Configure the view for the selected state
      }
  
  }
  </code></pre>
  
  <p>the IBOutlets are just links to the UILabels and UIImageViews but these don't need any values at the moment because they are added in the design at the moment. </p>
  
  <p>I have an ViewController file which is linked to a view controller on the storyboard, and this has a tableview on it. 
  and this is the code I have used for this, but how can i use the customCell I have created on this tableview (view controller). </p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
      func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return 0
      }
  
      func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
  
          let cell = tableView.dequeueReusableCellWithIdentifier("tableCell", forIndexPath: indexPath) as UITableViewCell
  
  
          return cell
      }
  </code></pre>
  
  <p>}</p>
  
  <p>Any help would be brilliant, thanks </p>
  
  <p>I have added : </p>
  
  <pre><code> var nib = UINib(nibName: "CustomTableViewCell", bundle: nil)
          tableView.registerNib(nib, forCellReuseIdentifier: "customCell")
  </code></pre>
  
  <p>to register the nib Name and register the cell in the tableview , and I have also changed the cellforindexpath to : </p>
  
  <pre><code>var cell:CustomTableViewCell = self.tableView.dequeueReusableCellWithIdentifier("CustomCell") as CustomTableViewCell
  </code></pre>