title: UITableView wont refresh after adding a new entry
body: <p>From my original view controller (BudgetViewController) I have a modal view controller that pops up when the &quot;add&quot; UIButton is selected. The user selects a new category and AddCategory() is dismissed. I have tried refreshing the UITableView inside of BudgetViewController() by adding  self.tableView.reloadData() inside of viewWillAppear(), viewDidAppear, and also as a completion handler but it still refuses to refresh the UITableView.</p>
  <pre><code> class BudgetViewController: UIViewController {
  
      var budgetData: [Transaction] = [
      Transaction(title: &quot;Groceries&quot;, dateInfo: &quot;0% out of spent&quot;, image:UIImage.groceriesIcon, amount: 4512)
                               ]
  
   func didTapAddCategory(_ button: UIButton) {
      let modalViewController = AddCategory()
      modalViewController.addCategoryCompletion = {
          self.tableView.reloadData()
         
      }
      present(modalViewController, animated: false, completion: modalViewController.addCategoryCompletion)
  }
  
  
     override func viewDidAppear(_ animated: Bool) {
      self.tableView.reloadData()
          }
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return self.budgetData.count
  }
  
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
      guard let cell = tableView.dequeueReusableCell(withIdentifier: CategoryCell.identifier) as? CategoryCell else { return UITableViewCell() }
      
      let data = budgetData[indexPath.row]
      cell.populate(with: data)
      cell.spentLabel.text = &quot;-&quot;
      cell.rangeLabel.text = &quot;&quot;
      return cell
  }
  
  
  
     class AddCategory: UIViewController{
  
        let budgetVC = BudgetViewController()
  
   var addCategoryCompletion: (() -&gt; Void)?
  
  
  @objc func prin(){
      budgetVC.budgetData.append(Transaction(title: textField.text ?? &quot;&quot;, dateInfo: &quot;n&quot;, image: UIImage.gymIcon, amount: 12, annualPercentageRate: 12, trailingSubText: &quot;12&quot;))
  
      self.dismiss(animated: false, completion: addCategoryCompletion)
      print(&quot;selected&quot;)
      print(budgetVC.budgetData)
  }
    let categoryTF: UITextField = {
      let tf = UITextField()
      
      tf.placeholder = &quot;  Category name&quot;
      tf.font = UIFont.systemFont(ofSize: 14)
      return tf
  }()
  
   let saveButton: UIButton = {
       let button = UIButton()
       button.setTitle(&quot;Save&quot;, for: .normal)
       button.layer.cornerRadius = 7
       button.addTarget(self, action: #selector(prin), for:.touchUpInside)
      return button
       
   }()
  
   }
  </code></pre>