title: Loading view from xib: this class is not key value coding-compliant for the key
body: <p>I have a question about loading view from XIB programmatically and using outlets:</p>
  
  <p>I created class for XIB's view:</p>
  
  <pre><code>class VoiceRecView: UIView {
  
      @IBOutlet weak var recButton: UIButton!
  
      override init(frame: CGRect) {
          super.init(frame: frame)
      }
      required init?(coder aDecoder: NSCoder) {
          super.init(coder: aDecoder)
      }
      @IBAction func recButtonTapped(_ sender: Any) {
          print("rec button tapped")
      }
  }
  </code></pre>
  
  <p>In the XIB I set file owner's class to my view controller and view class to "VoiceRecView".<br>
  In the view controller I add the XIB as subview:</p>
  
  <pre><code>let voiceRecView = UINib(nibName: "VoiceRecView", bundle: nil).instantiate(withOwner: self, options: nil)[0] as! VoiceRecView
  self.view.addSubview(voiceRecView)
  </code></pre>
  
  <p>And when I run the app I get the error:</p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception 'NSUnknownKeyException',
    reason: '[&lt;....ChatViewController 0x7fd0a27077e0>
    setValue:forUndefinedKey:]: this class is not key value
    coding-compliant for the key recButton.'</p>
  </blockquote>