title: Single directional (Height only) self sizing UI components preview
body: <p>I have a <code>UITableViewCell</code> containing a simple <code>UIStackView</code> and 2 <code>UILabel</code>s (<strong>So it is from <code>UIKit</code></strong>, NOT native SwiftUI) that should have a static width and dynamic height. How can I have a preview for this without need to see the actual phone size?</p>
  <p><strong>Note 1</strong>: <code>.sizeThatFits</code> will put all the weight on the <code>width</code> and there will be no multiline <code>label</code>s</p>
  <p><a href="https://i.stack.imgur.com/WHCCI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WHCCI.png" alt="sizeThatFits" /></a></p>
  <p><strong>Note 2</strong>: <code>.device</code> is showing extra useless empty spaces of the main view of the screen.</p>
  <p><a href="https://i.stack.imgur.com/9HDFK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9HDFK.png" alt="device" /></a></p>
  <p><strong>Note 3</strong>: <code>.fixed(width:height:)</code> is not prefered, because it will have less space or extra useless space as our needs.</p>
  <p><strong>Note 4</strong>: Need something like this: (For <code>UIStackView</code>)
  <a href="https://i.stack.imgur.com/SlVNR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SlVNR.png" alt="enter image description here" /></a></p>
  <hr />
  <h1>DEMO</h1>
  <pre><code>struct UILabelPorted: UIViewRepresentable {
      var configuration = { (view: UILabel) in }
  
      func makeUIView(context: UIViewRepresentableContext&lt;Self&gt;) -&gt; UILabel {
          let uiView = UIViewType()
          uiView.setContentHuggingPriority(.defaultHigh, for: .vertical)
          uiView.setContentHuggingPriority(.defaultHigh, for: .horizontal)
          return uiView
      }
  
      func updateUIView(_ uiView: UILabel, context: UIViewRepresentableContext&lt;Self&gt;) { configuration(uiView) }
  }
  
  struct UILabel_Previews: PreviewProvider {
      static var previews: some View {
          UILabelPorted {
              $0.text = &quot;This label should have multiple lines like it is in a UITableView cell.&quot;
          }
          .previewLayout(.sizeThatFits)
      }
  }
  </code></pre>