title: How to set the height of a cell depending on a UILabel with a typewriter effect
body: <p>I have a UILabel in a cell of UITableView.</p>
  
  <p>To adjust the height of the cell depending the height of the label, it's ok, it works perfectly.</p>
  
  <p>But I need to add another constraints.
  I need to display the UILabel with a typewriter effect (letter by letter).</p>
  
  <p>My extension for the effect works well:</p>
  
  <pre><code>extension UILabel{
  
      func setTextWithTypeAnimation(id:String, typedText: String, pauseCharacterArray: [Int:Double], characterInterval: TimeInterval = 0.06 ) {
  
          text = ""
  
          let group = DispatchGroup()
          group.enter()
  
          DispatchQueue.global(qos: .userInteractive).async {
  
              for (index, character) in typedText.characters.enumerated() {
  
                  DispatchQueue.main.async {
                      self.text = self.text! + String(character)
                  }
  
                  Thread.sleep(forTimeInterval: characterInterval)
              }
  
          group.leave()
      }
  
      group.notify(queue: .main) {
          //do something
      }
  }
  </code></pre>
  
  <p>I tried to call this function in my configureCell fund : </p>
  
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
      let cell = tableView.dequeueReusableCell(withIdentifier: "ParagraphTableViewCell", for: indexPath) as! ParagraphTableViewCell
  
      cell.delegate = self
      self.configureCell(cell: cell, atIndexPath: indexPath)
      return cell
   }
  
  
  func configureCell(cell: ParagraphTableViewCell, atIndexPath indexPath: IndexPath) {
  
      let paragraph = paragraphArray[indexPath.row] as! Paragraph
  
      let pauseCharactersArray:[Int:Double] = [1:0, 6:0]
      cell.dialogueLabel.setTextWithTypeAnimation(id:"intro", typedText: "lorem ipsum", pauseCharacterArray: pauseCharactersArray)
  }
  </code></pre>
  
  <p>But the label doesn't appear. I think it's because the height of the label in the cell is set to 0, and it's never updated.</p>
  
  <p>I don't know how to adjust the height of the cell "in live" (every time a character is displayed)</p>
  
  <p>EDIT </p>
  
  <p>I use autolayout </p>
  
  <p>EDIT 2</p>
  
  <p>The typewriter effect, run in a simple UILabel without UITableView: </p>
  
  <p><a href="https://i.stack.imgur.com/MVeP5.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/MVeP5.gif" alt="gif"></a></p>
  
  <p>The cell set in the xib:</p>
  
  <p><a href="https://i.stack.imgur.com/blSxu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/blSxu.png" alt="xib"></a></p>
  
  <p>When I run, the UILabel doesn't appear:</p>
  
  <p><a href="https://i.stack.imgur.com/vy31w.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vy31w.png" alt="run"></a></p>