title: Fit long text in to multiple lines in UILabel
body: <p>In my UI there is a <code>UILabel</code> and the text is set to it in the run time. If the text is too long it should show in two lines.</p>
  <p>The code of the UILabel is as follows.</p>
  <pre><code>    lazy var disLabel:UILabel = {
          let label = UILabel()
          label.translatesAutoresizingMaskIntoConstraints = false
          label.textAlignment = .left
          label.font = Fonts.fontForType(fontType: .AktivGroteskRegular, fontSize: 15.0)
          label.lineBreakMode = .byWordWrapping
          label.numberOfLines = 0
          label.backgroundColor = UIColor.red
          label.text = &quot;Hello world. How are you.  XaXaXa
          return label
      }()
  </code></pre>
  <p>Then I set the constraints as follows.</p>
  <pre><code>        label.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: 20).isActive = true
          label.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true
          label.trailingAnchor.constraint(equalTo: self.trailingAnchor).isActive = true
  </code></pre>
  <p>The output is as follows.</p>
  <p><a href="https://i.stack.imgur.com/7nxRC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7nxRC.png" alt="enter image description here" /></a></p>
  <p>Here there is enough space for the word &quot;you&quot;. But  it has gone to the second line. Always there is lots of space remains in the first line no matter what the text is.</p>
  <p>How to fix this.</p>