title: How can I get text to wrap in a UILabel (via UIViewRepresentable) without having a fixed width?
body: <p>Setting lineBreakMode to byWordWrapping and set numberOfLines to 0 does not seem to be sufficient:</p>
  
  <pre><code>struct MyTextView: UIViewRepresentable {
      func makeUIView(context: Context) -&gt; UILabel {
          let label = UILabel()
          label.lineBreakMode = .byWordWrapping
          label.numberOfLines = 0
          label.text = "Here's a lot of text for you to display. It won't fit on the screen."
          return label
      }
  
      func updateUIView(_ view: UILabel, context: Context) {
      }
  }
  
  struct MyTextView_Previews: PreviewProvider {
      static var previews: some View {
          MyTextView()
              .previewLayout(.fixed(width: 300, height: 200))
      }
  }
  </code></pre>
  
  <p>The text does not wrap, regardless of which setting I use for lineBreakMode. The canvas preview and live preview both look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/4ahO3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4ahO3.png" alt="Screenshot of the text not wrapping"></a></p>
  
  <p>The closest I've gotten is setting preferredMaxLayoutWidth, which does cause the text to wrap, but there doesn't seem to be a value that means "whatever size the View is".</p>