title: Update UITableView from 3rd container
body: <p><strong>I have such construction:</strong></p>
  
  <p>Container Number 1 (FirstViewContainer) with segment control
  contains:</p>
  
  <p>Container Number 2 (FoodViewContainer) with another segment control
  contains:</p>
  
  <p>Container Number 3 (MyFoodContainer) with UITableView</p>
  
  <p>I need to update UITableView on click from Container Number 1</p>
  
  <p>My code:</p>
  
  <p>CONTAINER 1 ACTION CODE:</p>
  
  <pre><code>  @IBAction func nextButton(_ sender: UIBarButtonItem) {
      print("clicked")
      var myClass : FoodViewController = self.children[1] as! FoodViewController
  
      myClass.relodDatabase()
  </code></pre>
  
  <p>CONTAINER 2 FUNC CODE:</p>
  
  <pre><code>func relodDatabase()
  {
      print("data reloaded")
      var myClass : MyFoodContainer = self.children[1] as! MyFoodContainer
  
      myClass.myFoodTable.reloadData()
      if myClass.foodList.count == 0 {
          myClass.myFoodTable.setEmptyView(title: "You don't have any food.", message: "Your food will be in here after adding.")
      }
  
      else {
          myClass.myFoodTable.restore()
      }
  
      myClass.viewWillAppear(true)
  
      var secondClass: CustomFoodContainer = self.children[2] as! CustomFoodContainer
  
      secondClass.foodList = TrackerDatabase.instance.getFoood(dname: dayTable)
      secondClass.viewWillAppear(true)
  }
  </code></pre>
  
  <p>The issue is that nobody happens when I try to reload things.
  However, print("data reloaded" executes correct.</p>
  
  <p>The interesting thing, that I can reload table view from 2 containers, one parent, one child.
  I cannot do it via parent>child>child's child</p>
  
  <p>Any idea how I can do this correct? Maybe some bypass?</p>
  
  <p><strong>I included an image:</strong></p>
  
  <p>On each arrow next to or arrow back, the table should reload, the table is on container number 3.</p>
  
  <p><a href="https://i.stack.imgur.com/bxOPn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bxOPn.png" alt="enter image description here"></a></p>