title: UITableView returning nil when reloadData method is called upon it
body: <p><strong>Project Information:</strong></p>
  
  <p>I have three views: 'Main, AddTask, and TaskTable' and three view controllers: 'MainVC, AddTaskVC, TaskTableVC'. 
  My 'Main' view has an embedded 'UITableView' which is 'TaskTable'. 
  My 'Main' view also has a button that presents a modal view which is 'AddTask'.
  My 'AddTask' view has a button that dismisses itself.
  My 'TaskTableVC' has an object named 'taskTable' which is the 'UITableView'</p>
  
  <p><strong>Goal:</strong></p>
  
  <p>I have been trying to call <code>reloadData</code> on <code>taskTable</code> when the modal view <code>AddTask</code> is dismissed. However, no matter how I tackle this I cannot call <code>reloadData</code> on the <code>taskTable</code> because it always seems to be nil after <code>AddTask</code> appears for the first time.</p>
  
  <p><strong>Problem Research:</strong></p>
  
  <p>The first thing I did was directly call <code>reloadData()</code> on my <code>taskTable</code> object using <code>completion</code> when the <code>AddTask</code> was dismissed : </p>
  
  <pre class="lang-swift prettyprint-override"><code>self.dismiss(animated: true, completion: {           
      TaskTableVC().taskTable.refreshData()
  })
  </code></pre>
  
  <p>but I quickly learned that I cannot call it directly because the <code>TaskTable</code> view was not loaded and I was creating an instance. </p>
  
  <p>Next, I put print statements on my <code>viewDidLoad</code> for my three views (see Project Information). On startup, the first thing that loads is my <code>TaskTable</code> and then my <code>Main</code>. When I click a button on my <code>Main</code> my <code>AddTask</code> loads. So far so good... However, when I dismiss my <code>AddTask</code>, nothing loads. I thought my <code>TaskTable</code> and <code>Main</code> would get loaded but that was not the case. So I tried calling a function <code>refreshData()</code> that was part of <code>MainVC</code> on <code>completion</code> of <code>dismiss</code> in <code>AddTaskVC</code> The function would load the <code>TaskTable</code> view using <code>loadViewIfNeeded</code>:</p>
  
  <pre class="lang-swift prettyprint-override"><code>func refreshData() {
       TaskTableVC().loadViewIfNeeded()
  }
  </code></pre>
  
  <p>Then in my <code>TaskTableVC</code> under my <code>viewDidLoad</code> I have:</p>
  
  <pre class="lang-swift prettyprint-override"><code>override func viewDidLoad() {
      super.viewDidLoad()
      print("table view loaded")
      self.taskTable.reloadData()
  }
  </code></pre>
  
  <p>Yet the error I continue to get is: <code>Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value</code>
  I believe this is because I called <code>TaskTableVC.loadViewIfNeeded()</code> via an instance? Whatever the case may be, I cannot get this to work for the life of me.</p>
  
  <p><strong>TL;DR</strong>
  I need to call <code>reloadData</code> on an embedded <code>UITableView</code> when I call dismiss on a modal view.</p>
  
  <pre class="lang-swift prettyprint-override"><code>//MainVC:
  class MainVC: UIViewController {
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view.
          print("main view loaded")
      }
  
      func refreshData() {
          TaskTableVC().loadViewIfNeeded()
      }
  }
  </code></pre>
  
  <pre class="lang-swift prettyprint-override"><code>//AddTaskVC
  class AddTaskVC: UIViewController {
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view.
          print("AddTask view loaded")
      }
      //...
      @IBAction func addTask(_ sender: Any) {
          //...
          self.dismiss(animated: true, completion: {     
              MainVC().refreshData()
          })
      }
  }
  </code></pre>
  
  <pre class="lang-swift prettyprint-override"><code>//TaskTableVC
  class TaskTableVC : UITableViewController {
  
      @IBOutlet var taskTable: UITableView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          print("table view loaded")
          self.taskTable.reloadData() //error here
      }
      //...
  }
  </code></pre>