Recording a variable value by date

Hi Code Crew,
I need some helping hint for my project. Project overview is as under:
I have a counter that increments by one when the user taps each time on a button.
I am able to save the counter variable value in userDefaults.
However what I would like to do is at the end of the day the app, whether running or not, reads that counter value and populates it in a table view row on a different screen. The table view row as a date label and another label that stores the counter value.
Does anyone know who to do this? Please drop me a line. Thanks.

I’d save the data to Firebase and create a cloud function that runs at your specified time and calculates what you want.

Then the view with the tableview just goes and grabs those calculated values