title: Passing data between TabBarController, not updating label
body: <p>I´m trying to pass data between TabBarController using <a href="https://stackoverflow.com/questions/29734954/how-do-you-share-data-between-view-controllers-and-other-objects-in-swift">this example</a></p>
  
  <p>Problem is, that the label in ViewController2 won´t update.</p>
  
  <p>Here is the code I´m using:</p>
  
  <p>TabBarController:</p>
  
  <pre><code>import UIKit
  
  class CustomTabBarController: UITabBarController {
      var myInformation: [String ] = []
  
      override func viewDidLoad() {
          super.viewDidLoad()
  }
  </code></pre>
  
  <p>ViewController1:</p>
  
  <pre><code>class ViewController1: UIViewController {
  
      var items = [String]()
  
      @IBOutlet weak var label: UILabel!
  
  
      @IBAction func item1(_ sender: UIButton) {
     items += ["Audi"]
          print(items)
      }
  
  override func viewDidLoad() {
          super.viewDidLoad()
      if let tbc = self.tabBarController as? CustomTabBarController {
          tbc.myInformation = items
      }
  
  }
  </code></pre>
  
  <p>ViewController2</p>
  
  <pre><code>class ViewController2: UIViewController {
  
      @IBOutlet weak var label: UILabel!
  
  
      override func viewDidLoad() {
          super.viewDidLoad()
          if let tbc = self.tabBarController as? CustomTabBarController {
  
                for item in tbc.myInformation {
                  label.text = item
                  }
          }
  }
  </code></pre>
  
  <p>I guess, since </p>
  
  <pre><code>if let tbc = self.tabBarController as? CustomTabBarController {
          tbc.myInformation = items
      }
  </code></pre>
  
  <p>is in viewDidLoad, it won't update when the item1 button is pushed?
  But X-code won't allow me to put it elsewhere.
  How should I go about to get the button to update the array?</p>