title: Custom UIViewController with UIViewcontrollerRepresentable that has a UITextView that crashes or is nil when called in SwiftUI
body: <p>I have made a custom <code>UIViewController</code> called <code>ViewControllerA</code> and want to be able to use it so I made a <code>UIViewControllerRepresentable</code> called  <code>ViewControllerARepresentable</code> as shown below, the problem though is that when I call <code>ViewControllerARepresentable</code> in my SwiftUI view and pass a value for <code>stringToUpdateTextView</code>, the <code>ViewControllerA</code> says the <code>htmlTextView(UITextView)</code> in <code>ViewControllerA</code> is <code>nil</code> and I'm not sure why.</p>
  
  <pre class="lang-swift prettyprint-override"><code>ViewControllerARepresentable(stringToUpdateTextView: "&lt;html&gt;Send some Html Text as string here&lt;/html&gt;")
  </code></pre>
  
  <p><em>ViewControllerARepresentable</em></p>
  
  <pre class="lang-swift prettyprint-override"><code>public struct ViewControllerARepresentable: UIViewControllerRepresentable {
    var stringToUpdateTextView: String
  
    public func makeUIViewController(context: Context) -&gt; ViewControllerA {
      let viewcontrollerA = ViewControllerA(testString: testingString)
  
      return viewcontrollerA
    }
  
    public func updateUIViewController(_ uiViewController: ViewControllerA, context: Context) {}
  }
  </code></pre>
  
  <p><em>ViewControllerA</em></p>
  
  <pre class="lang-swift prettyprint-override"><code>open class ViewControllerA: UIViewController {
  
    public var stringToUpdateTextView: String
  
    override open func viewDidLoad() {
      super.viewDidLoad()
  
  htmlTextView.text = stringToUpdateTextView
    }
  
    @IBOutlet weak var htmlTextView: UITextView!
  
    public init(testString: String) {
      self.testString = testString
      super.init(nibName: nil, bundle: nil)
    }
  
    required public init?(coder: NSCoder) {
      fatalError("init(coder:) has not been implemented")
    }
  }
  </code></pre>
  
  <p>Crash occurs at  <code>htmlTextView.text = stringToUpdateTextView</code> saying that htmlTextView.text is nil even though its an IBOutlet.
  Any Change made to the htmlTextView like background color ,etc, also causes a crash if called in viewDidAppear or viewDidLoad</p>