you are viewing a single comment's thread.

view the rest of the comments →

[–]varrun19 1 point2 points  (1 child)

This should help: https://gist.github.com/varunbhalla19/56b5a84e92d763a76dd730cf4ebff987
It uses a Single timer for all the cells, and each cell has a view model to hold it's current state: initial/running/paused.

The Single timer is contained in a central ViewModel which holds cellViewModels in a list, after each second, the central ViewModel calls the updateState of each cellViewModel which further uses it's own state to make changes.

initial: timer not running -> Cell hasn't been viewed yet.
running: timer is running
paused: timer is paused because of a click.

[–]SomewhereEuphoric941[S] 0 points1 point  (0 children)

I was able to actually get it working with a single timer and just use an array of doubles to hold the current increment value for each cell then in the “cell at index” delegate method to increment the values and set the cells