Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practice to sync webservice with offline storage on iOS

I have been working on a few iOS applications that talk to a REST API on the web server and than sync some data down for offline usage. The app then stores data locally if network connection is not available and than syncs with backend whenever the Internet connection is available.

I am wondering if there is a nice pattern or set of rules or library that can be used. I would rather not code this again and again. I know the business logic / sync logic would be different for each app but the rest of the work (ie. storing it locally, calling REST API) can be abstracted out.

Any ideas?

like image 688
Obaid Avatar asked Jun 13 '13 13:06

Obaid


1 Answers

I use the RestKit framework in my app for the exact scenario you describe. The downloaded data are stored in a Core Data store for offline usage.

like image 175
John Topley Avatar answered Oct 07 '22 23:10

John Topley