Adding sections, separated by dates, to UITableView in Swift

I'm a complete rookie at Swift and iOS programming so you'll have to forgive the perhaps simple question.

I've created a tableView which displays the contents of an array (strings) at the press of a button.
Now, I'd like to "group" these strings in tableView sections, sorted by date.

In more detail: When the user taps the button, the string should be inserted at index 0 of the array and be displayed in a section with a header of todays date. If there's values older than today's date in the array, these should be displayed in a separate section for that date. Each section should correspond to a 24 hour day and display all the strings added during that day.