In the previous article we created very simple SyncService service that can send and receive data between iOS as watch app. Which is good for very simple scenarios, but when application complexity is growing it is really important to keep you code clean, and well organized. In this article we will try to isolate sync logic from the rest of the application.
In one of my project I had to synchronize data based on different events, in different part of application. But all that code had a lot in common. So, to clean up it a bit and make it more reusable I introduced generic SyncObject class that encapsulates all basic sync logic.