title: Best way to tell the UITableView which data should be display in Swift
body: <p>I'm new to Swift and I followed some tutorials.
  They are showing how you are suppose to use a UITableView by using a UITableViewController.
  The data displayed in the UITableView are stored in an Array inside the UITableViewController.
  I'm OK with it.</p>
  
  <p>Based on this, I tried to make a UITableView with two arrays :</p>
  
  <pre><code>struct Spending {
      var title: String
      var amount: Float
      var date: Date?
   }
  
  class TableViewControllerSpending: UITableViewController, SpendingProtocol {
          var spendingsTemporary : [Spending] = [Spending(title: "Shoes", amount: 245.99, date: Date())]
          var spendingsPermanent : [Spending] = [Spending(title: "Taxes", amount: 125.50, date: Date())]
  }
  </code></pre>
  
  <p>I would like to use 2 arrays to display both of them depending on the navigation. For instance, when you click on a button "My permanent spending" the UITableView only shows the 'permanent' array data or if you click on "All my spending" you can see the content of the 2 arrays.</p>
  
  <p>What is the best solution to do tell the UITableView which data should be display ?</p>
  
  <p>Thank you. </p>