У меня есть объект модели, возвращаемый в JSON из Firebase.
{
"id": 1,
"name": "Jon Doe",
"time": ["1525592246"]
},
{
"id": 2,
"name": "Jane Doe",
"time": ["1525592266"]
},
Я хотел бы структурировать эти объекты в разделы в UITableView на основе следующего:
enum DiarySectionType {
case Today
case Tomorrow
case ThisWeek
case ThisMonth
case Later
}
То есть, если «время» сегодня, оно будет в сегодняшнем разделе UITableView.
Как лучше всего подойти к этому? Я думал о том, чтобы иметь отдельные массивы для каждого. Но не думайте, что это правильный путь.
Как всегда приветствуется любая помощь.