title: How to load a UITableView from a nib file into a container view in a parent view controller?
body: <p>I am trying to load a view controller (lets call this VC2) that contains a table view into a container view within a parent view controller (VC1). The issue I am running into is when I try register the nib or set delegate/data source of the tableview in VC2 I am getting a nil error.</p>
  
  <p>I have tried removing the <code>delegate</code> and <code>dataSource</code> connection but this just loads a blank tableview</p>
  
  <p>This is the code I used to transfer data to the container view controller:</p>
  
  <pre><code>   override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
          if let listVC = segue.destination as? BusinessListViewController {
              listVC.bottomSheetDelegate = self
              listVC.Businesses = self.Businesses
              listVC.parentView = businessListView
              listVC.viewDidLoad()
           }
      }
  </code></pre>
  
  <p>and this the <code>viewDidLoad()</code> statement in VC2 </p>
  
  <pre><code>    override func viewDidLoad() {
          super.viewDidLoad()
          BusinessListTableView.dataSource = self
          BusinessListTableView.delegate = self 
          BusinessListTableView.register(UINib.init(nibName: "BusinessTableViewCell", bundle: nil), forCellReuseIdentifier: "BizCell")
      }
  </code></pre>
  
  <p>I am hoping that someone can help figure out how to get this nib to populate properly. It was working when VC2 is navigated to via a segue.</p>