title: How to change height of UITableView cell in Swift?
body: <p>I am trying to show a comment on an app like in the following pictures. I'm using Xcode 9.4.1.</p>
  
  <p><a href="https://i.stack.imgur.com/KfnVD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KfnVD.png" alt="app view"></a></p>
  
  <p>I use the following code to hide the label:</p>
  
  <pre><code>if commentManager == nil {
      cell.managerReplyLabel.isHidden = true
      cell.ratingManagerLabel.isHidden = true
  }
  </code></pre>
  
  <p>But it looks still like it has a space on it which I hidden two labels.</p>
  
  <p>I try to use <code>cell.ratingManagerLabel.font.withSize(0)</code> or <code>
  cell.ratingManagerLabel.frame.size.height = 0</code> to change the label hight, but it doesn't work.</p>
  
  <p>How to reduce the space?</p>
  
  <p><em>Update:</em></p>
  
  <p>I use storyboard to set the screen and auto-layout.</p>
  
  <p><a href="https://i.stack.imgur.com/NV4UR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NV4UR.png" alt="autolayout"></a></p>
  
  <pre><code>import UIKit
  import Cosmos
  
  class RatingTableViewCell: UITableViewCell {
  
      @IBOutlet weak var userNameLabel: UILabel!
      @IBOutlet weak var ratingStar: CosmosView!
      @IBOutlet weak var ratingUserLabel: UILabel!
      @IBOutlet weak var ratingManagerLabel: UILabel!
  
      @IBOutlet weak var managerReplyLabel: UILabel!
  
  }
  </code></pre>