title: I need to sort data from an array into UITableView sections with the date as the section header with any date as todays date as 'Today' etc
body: <p>So I have an array of data that was created with a struct e.g.:</p>
  
  <pre><code>struct Struct {
    let id = UUID()
    let name: String
    let date: Date
    let amount: Float
  }
  extension Struct {
    init(name: String, amount: Float) {
      self.name = name
      self.date = Date()
      self.amount = amount
    }
  }
  </code></pre>
  
  <p>This is then used to create an array of structs e.g.:</p>
  
  <pre><code>var structs = [Struct]()
  let name = ["struct1", "struct2", "struct3"]
  let amount = [1, 2, 3]
  
  let structsCount = name.count
  for i in 0..&lt;structsCount {
    structs.append(Struct(name: name[i], amount: Float(amount[i])))
  }
  </code></pre>
  
  <p>This is just used for dummy data so I understand that the date will always be the current date.
  I have seen suggestions of arranging the <code>structs</code> array into a Dictionary using the date property and then sorting the Dictionary by that date.
  I just can't seem to get this to work.</p>
  
  <p>Any ideas would be greatly appreciated.</p>