title: Custom UIView is blank when instantiated from a XIB in Swift 4
body: <p>I have a custom view that I am trying to load from a custom XIB, but the view appears to be blank when loaded, even thought it has the correct sizes when debugged.</p>
  
  <p>My debug statements show that the frame has the correct sizes:</p>
  
  <blockquote>
    <p>commonInit()<br>
    XIB: MyCustomView<br>
    myView Frame: (0.0, 0.0, 320.0,568.0)<br>
    myView ContentSize: (320.0, 710.0) </p>
  </blockquote>
  
  <p>This is my custom VC that I am using to call my Custom View</p>
  
  <pre><code>class MyCustomViewController: UIViewController {
  
      var myView : MyCustomView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          myView = MyCustomView(frame: self.view.frame)
  
          self.view.addSubview(myView)
  
          updateScrollViewSize()
  
          print("myView Frame: \(myView.frame)")
          print("myView ContentSize: \(myView.contentView.contentSize)")
  
      }
  
      func updateScrollViewSize () {
          var contentRect = CGRect.zero
          for view in myView.contentView.subviews {
              contentRect = contentRect.union(view.frame)
          }
          myView.contentView.contentSize = CGSize(width: myView.contentView.frame.size.width, height: contentRect.size.height + 5)
      }
  }
  </code></pre>
  
  <p>There is a <code>XIB</code> that has the files owner as <em>MyCustomView</em> and all the outlets are hooked up correctly.</p>
  
  <pre><code>class MyCustomView: UIView {
  
       let kCONTENT_XIB_NAME = "MyCustomView"
  
      @IBOutlet var contentView: UIScrollView!
  
      @IBOutlet weak var lbl_datein: UILabel!
      //.. A bunch of other GUI elements for the scrollview
      @IBOutlet weak var text_location: UITextField!
  
  
      override init(frame: CGRect) {
          super.init(frame: frame)
          commonInit()
      }
  
      required init?(coder aDecoder: NSCoder) {
          super.init(coder: aDecoder)
          commonInit()
      }
  
      func commonInit() {
          print(#function)
          print("XIB: \(kCONTENT_XIB_NAME)")
  
          Bundle.main.loadNibNamed(kCONTENT_XIB_NAME, owner: self, options: nil)
          contentView.addSubview(self)
          contentView.frame = self.bounds
          contentView.backgroundColor = .blue
      }
  }
  </code></pre>
  
  <p>Does anyone see what I have done wrong when trying to load the view</p>