title: How to set label height for auto adjust in Read More/Less with Swift 3?
body: <p>I would like to create the paragraph with Read More/Read Less at the end. <br> Here are my codes; <br></p>
  
  <pre><code>func getLabelHeight(text: String, width: CGFloat, font: UIFont) -&gt; CGFloat {
  
      let lbl = UILabel(frame: .zero)
      lbl.frame.size.width = width
      lbl.font = font
      lbl.numberOfLines = 0
      lbl.text = text
      lbl.sizeToFit()
      lbl.adjustsFontSizeToFitWidth = true
      return lbl.frame.size.height
  
  }
  </code></pre>
  
  <p><br></p>
  
  <pre><code> @IBAction func btnReadMore(_ sender: Any) {
      if isLabelAtMaxHeight {
  
          btnReadmore.setTitle(NSLocalizedString("Read more", comment: ""), for: .normal)
          btnReadmore.titleLabel!.font = UIFont (name: "Tharlon", size: 13)
          isLabelAtMaxHeight = false
          lblReviewHeight.constant = 29
          lblReview.font = UIFont (name: "Tharlon", size: 13)
  
  
      }
      else {
  
          btnReadmore.setTitle(NSLocalizedString("Read less", comment: ""), for: .normal)
          btnReadmore.titleLabel!.font = UIFont (name: "Tharlon", size: 13)
          isLabelAtMaxHeight = true
          lblReviewHeight.constant = getLabelHeight(text: lblReview.text!, width: view.bounds.width, font: lblReview.font)
          lblReview.font = UIFont (name: "Tharlon", size: 13)
          lblReview.lineBreakMode = NSLineBreakMode.byTruncatingHead
  
      }
  
  }
  </code></pre>
  
  <p><br>
  I also set the label "Word wrap" in Attributes Inspector. <br>
  The problem is that when I add <strong>"NSLineBreakMode.byTruncatingHead"</strong> in Read Less part, all the texts show completely. But, some words in those places inside text disappear. <br></p>
  
  <p>So, I remove that code and run the app. At that time, texts are not shown completely and only show half. I've been trying to solve this problem the whole day. <br>
  I don't want to use any other library. <br> 
  Could anyone help me please?</p>