I have a model object being returned in JSON from Firebase.
{
"id": 1,
"name": "Jon Doe",
"time": ["1525592246"]
},
{
"id": 2,
"name": "Jane Doe",
"time": ["1525592266"]
},
I would like to structure these objects into sections in a UITableView based on the below:
enum DiarySectionType {
case Today
case Tomorrow
case ThisWeek
case ThisMonth
case Later
}
I.e If a "time" is today it will be in the today section of the UITableView
What is the best way to approach this? I've thought of having separate arrays for each. But don't think that's the way to go.
As always any help appreciated.