title: Custom table view cell: IBOutlet label is nil
body: <p>Consider the following simple view controller:</p>
  
  <pre><code>class ViewController: UIViewController, UITableViewDataSource {
      @IBOutlet weak var tableView: UITableView!
  
      var items = ["One", "Two", "Three"]
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          self.tableView.registerClass(CustomTableViewCell.self, forCellReuseIdentifier: "customCell")
          self.tableView.dataSource = self
      }
  
      func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return self.items.count;
      }
  
      func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
          let cell = self.tableView.dequeueReusableCellWithIdentifier("customCell") as CustomTableViewCell
          cell.titleLabel!.text = self.items[indexPath.row]
          return cell
      }
  }
  </code></pre>
  
  <p>And custom cell view:</p>
  
  <pre><code>class CustomTableViewCell: UITableViewCell {
      @IBOutlet weak var titleLabel: UILabel!   
  }
  </code></pre>
  
  <p>This code causes the following error.</p>
  
  <blockquote>
    <p>fatal error: unexpectedly found nil while unwrapping an Optional value</p>
  </blockquote>
  
  <p><code>titleLabel</code> is nil — it's not clear why. Setting default properties of <code>UITableViewCell</code> (like <code>textLabel</code>) work just fine.</p>
  
  <p>I'm using a nib for the custom cell.</p>
  
  <p>Both the labels and table views are correctly connected to their <code>IBOutlet</code>s.</p>
  
  <p><img src="https://i.stack.imgur.com/Lh5VC.png" alt="label">
  <img src="https://i.stack.imgur.com/RjKUK.png" alt="table view"></p>
  
  <p>Both the prototype cell and the custom nib view are marked as having a <code>CustomTableViewCell</code> class.</p>
  
  <p>I'm new to iOS development, am I missing something obvious?</p>
  
  <p><a href="https://www.dropbox.com/s/vzewdc0fz8p9o9o/CustomTableViewCellExample.zip?dl=0" rel="noreferrer">Sample Xcode project available</a>.</p>