title: On awakeFromNib() - Error Instance member 'button' cannot be used on type 'CustomView'
body: <p>I've created a custom UIView as a .xib file with the UIView having a single button. I load the UIView using the below code. </p>
  
  <pre><code>struct ContentView: View {
      var body: some View {
          CustomViewRepresentable()
      }
  }
  
  struct CustomViewRepresentable: UIViewRepresentable {
      typealias UIViewType = CustomView
  
      func makeUIView(context: UIViewRepresentableContext&lt;CustomViewRepresentable&gt;) -&gt; CustomView {
          let customView = Bundle.main.loadNibNamed("CustomView", owner: nil, options: nil)![0] as! CustomView
          return customView
      }
  
      func updateUIView(_ uiView: CustomView, context: UIViewRepresentableContext&lt;CustomViewRepresentable&gt;) {
      }
  }
  </code></pre>
  
  <p>The custom view has the below code:</p>
  
  <pre><code>class CustomView: UIView {
  
      @IBOutlet weak var button: UIButton!
  
      override init(frame: CGRect) {
          super.init(frame: frame)
      }
  
      required init?(coder: NSCoder) {
          super.init(coder: coder)
      }
  
      override class func awakeFromNib() {
          super.awakeFromNib()
          // Error - Instance member 'button' cannot be used on type 'CustomView'
          button.addTarget(self, action: #selector(touchUpInside), for: .touchUpInside)
      }
  
      @objc func touchUpInside(_ sender: UIButton) {
          print("Button clicked")
      }
  }
  </code></pre>
  
  <p>I've uploaded the source code to github. Here's the link <a href="https://github.com/felixmariaa/AwakeFromNibTest/" rel="noreferrer">https://github.com/felixmariaa/AwakeFromNibTest/</a></p>
  
  <p>This is supposed to work and I'm not sure what is going wrong.</p>