title: Swift automatic height for UITableViewCell
body: <p>I am trying to make table with a large text in basic cell.
  Table is in UIVIewController, that implements Delegate and DataSource.</p>
  
  <p>it's my ViewController:</p>
  
  <pre><code>class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
  
  let answers = ["Swift is a multi-paradigm, compiled programming language created by Apple Inc. for iOS, OS X, and watchOS development. Swift is designed to work with Apple's Cocoa and Cocoa Touch frameworks and the large body of existing Objective-C code written for Apple products. Swift is intended to be more resilient to erroneous code than Objective-C, and also more concise. "]
  
  func numberOfSectionsInTableView(tableView: UITableView) -&gt; Int {
      return 1
  }
  
  func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return 1
  }
  
  func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
      let cell = tableView.dequeueReusableCellWithIdentifier("basic", forIndexPath: indexPath) as! UITableViewCell
  
      cell.textLabel?.numberOfLines = 0
      cell.textLabel?.lineBreakMode = .ByWordWrapping
      cell.textLabel?.text = answers[indexPath.row]
      return cell
  }
  
  }
  </code></pre>
  
  <p>I set <code>.numberOfLines = 0</code>, but as a result, I have only 2 lines: <a href="https://i.stack.imgur.com/g1PgJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g1PgJ.png" alt="enter image description here"></a></p>
  
  <p>How I can fix it? I hear that in IOS 8 it is much easier than in IOS &lt; 8, and i don't need <code>tableView.heightForRowAtIndexPath</code>. But if I need, how to implement it a simpler?</p>
  
  <p>Maybe i need to set constraints to my cell? But it's a basic Cell.</p>