Posts

Post not yet marked as solved
1 Replies
4.6k Views
I am working with Swift 3 and have a Timer object running which is counting for the duration of a specific task in a list. When that task completes, it moves onto the next task.The tasks are shown in a UITableView which the user can scroll through whilst the top task is being processed. I have noticed that when scrollling through the table, this seems to impact the firing of the timer (interval is 1 sec) and over the course of working on a number of tasks it is losing time. At the start, I calculate how long the overall list of tasks will take to finish and show this as a target completion time. If I don't do any scrolling, the tasks complete exactly on time. If I scroll about, the tasks finish late.I have been looking online for solutions and there seems to be examples of this in Swift 2 which uses NSTimers and NSRunLoop to help get around this. I tried something similar in Swift 3 with RunLoop but doesn't seem to help.Any pointers?Thanks,Rob.
Posted Last updated
.