title: Creating a UITableViewCell programmatically in Swift
body: <p>I am trying to create a custom cell for my <code>UITableView</code> but I am having some difficulty.</p>
  
  <p>First off I cannot use the Interface Builder, as I am experiencing <a href="https://stackoverflow.com/questions/26478246/text-views-and-image-view-disappearing-from-view-controller-in-xcode-6-1-storybo">a variation on this bug in Xcode</a>. Every time I click on an element in the Interface Builder everything in that view gets a height and width of zero and gets repositioned outside of the view. Besides, I would like to learn how to do this programmatically.</p>
  
  <p>Secondly I am using the Swift language for my project. <a href="http://jainmarket.blogspot.co.uk/2009/05/creating-custom-table-view-cell.html" rel="nofollow noreferrer">I have been trying to follow this demonstration</a>, and doing my best to convert the Objective C code over to Swift, but whenever I run into problems I end up being stuck. I presume this is because I am not converting the code over correctly.</p>
  
  <p>Thirdly <a href="https://www.youtube.com/watch?v=FTt7doXcYjc" rel="nofollow noreferrer">I found this video</a> but despite being fairly difficult to follow (lots of the code is just copied and pasted without much explanation to what it does or why), it still ends up using the Interface Builder to change various parts.</p>
  
  <p>I have a basic <code>UITableView</code> set up fine. I just want to be able to add a custom cell to that table view.</p>
  
  <ul>
  <li><p>Can this be done using pure programming, or do I need to use the Interface Builder?</p></li>
  <li><p>Can anyone point me in the right direction or help me out in creating a custom cell programmatically in Swift?</p></li>
  </ul>
  
  <p>Many thanks.</p>