Update tableView in swift 5

I'm pulling data from Firestore and listing it in my table. However, according to the conditions in the data I have taken, the color or touch of the data in my table must change. In the codes I wrote, this works, but sometimes the data does not come and naturally the table is not updated. Or when I scroll the list the data comes and the list is updated. How can I do this without problems? I am posting my codes and screenshot.

when i choose the date

not working when i select a date again

it shows the error "[UICollectionViewRecursion] cv == 0x1088d4600 Disabling recursion trigger logging" when no data is received.

please someone help me by changing my codes or showing me a different way.

When you show your code, you should use the Code Block feature, not images. With showing easily readable code in easily reusable way, more readers would to try to solve your issue.

You should also reduce the size of the screen captures, that will make the post more readable (use the adjust zize menu in Preview).

not working when i select a date again

What do you expect exactly here ?

Note: this is how it looks when reducing by a factor of 4. Still perfectly readable and much easier to follow the thread.

In getDateFromCalendar, you do not reload any data in table. So color will not change for visible cells, only when you scroll enough and force a reload.

Update tableView in swift 5
 
 
Q