0

I have been working on an app that has a like button. Anytime a user likes or unlikes an item, a request will be sent to the server to change the field in the DB.

Unfortunately there is a 1 second delay from the server time to do the change before the UX reflecting the change.

What's the best method to make this real time for the users? Should we use Core Data with some local Queing mechanism for such changes in the background? Any suggestions on what's the standard to do these changes real time? (similar to pressing the like button in FB).

Thanks, Ross

Faz Ya
  • 1,480
  • 2
  • 15
  • 22

1 Answers1

1

You should use an asynchronous request so you do not block the UI thread. You can see this answer for reference: https://stackoverflow.com/a/8515791/3802077

Then you would be free to modify your UI before receiving a confirmation from the server and correct your UI accordingly in case of error.

Community
  • 1
  • 1
user3802077
  • 849
  • 9
  • 22