title: Determine UIViewRepresentable with a custom UIView size dynamically
body: <p>I have an issue when trying to convert a custom View that inherits from UIView into a SwiftUI view, the view takes the whole screen.
  But it works pretty well if I inherit from UILabel instead of UIView.</p>
  <p><strong>Note</strong> This view is shown inside a <code>UIHostingController</code>.</p>
  <pre><code>class ViewController: UIViewController {
      
      let hostingVC = UIHostingController(rootView: SwiftUIView())
      
      override func viewDidLoad() {
          super.viewDidLoad()
          addChild(hostingVC)
          view.addSubview(hostingVC.view)
          hostingVC.didMove(toParent: self)
          hostingVC.view.backgroundColor = .red
          hostingVC.view.wh_activateConstraints(configuration: {
              [
                  $0.topAnchor.constraint(equalTo: view.topAnchor),
                  $0.leadingAnchor.constraint(equalTo: view.leadingAnchor),
                  $0.trailingAnchor.constraint(equalTo: view.trailingAnchor),
                  $0.bottomAnchor.constraint(equalTo: view.bottomAnchor),
              ]
          })
      }
      
      
  }
  </code></pre>
  <p>Example 1:
  this will work</p>
  <pre><code>struct SwiftUIView: View {
  var body: some View {
      VStack {
          CustomLabel()
              .fixedSize(horizontal: false, vertical: true)
      }
  }
  struct CustomLabel: UIViewRepresentable {
      
      func updateUIView(_ uiView: UIViewType, context: Context) {
      }
      
      func makeUIView(context: Context) -&gt; some UIView {
          let view = UILabel()
          view.text =  &quot;hello world&quot;
          view.backgroundColor = .green
          return view
      }
  }
  </code></pre>
  <p>Example 2: this will not work</p>
  <pre><code>struct SwiftUIView: View {
      var body: some View {
          VStack {
              CustomLabel()
                  .fixedSize(horizontal: false, vertical: true)
          }
      }
  }
  
  
  struct CustomLabel: UIViewRepresentable {
      
      func updateUIView(_ uiView: UIViewType, context: Context) {
      }
      
      func makeUIView(context: Context) -&gt; some UIView {
          let view = CustomUIlabel()
          view.backgroundColor = .green
          return view
      }
  }
  
  
  class CustomUIlabel: UIView {
      init(){
          super.init(frame: .zero)
          let label = UILabel(frame: .zero)
          label.text =  &quot;hello world&quot;
          label.translatesAutoresizingMaskIntoConstraints = false
          addSubview(label)
          NSLayoutConstraint.activate(
              [
                  label.topAnchor.constraint(equalTo: topAnchor),
                  label.leadingAnchor.constraint(equalTo: leadingAnchor),
                  label.trailingAnchor.constraint(equalTo: trailingAnchor),
                  label.bottomAnchor.constraint(equalTo: bottomAnchor)
              ]
          )
      }
      
      required init?(coder: NSCoder) {
          fatalError(&quot;init(coder:) has not been implemented&quot;)
      }
  }
  </code></pre>
  <p>And when adding <code>.fixedSize(horizontal: false, vertical: true)</code> for second example the custom view will disappear.
  and If I comment it, the view will take the whole screen.</p>
  <p>Is there any solution to determine the size dynamically of a custom view that inherits from UIView?</p>