In my app I am fetching RESTful data asynchronously from mutiple servers and merge the responses into an array when they are available: let respModel = [responses] I use didSet to check whether respModel is set and then trigger myTableView.reloadData() to udpate the table view each time
Sporadically, my app crashes during table view refresh and I think it's because two RESTful api calls arrive at exactly the same time, creating a deadlock on the respModel
I want to keep the current async functionality in, to get my table view updated whenever a fresh response arrives, but I also want to find a solution to the deadlock problem.
What's the best way to handle it?