Jun 20, 2015:  ~ 45 sec read

[EP] iCloud sync

I already love Swift 2.0.

First, defer, to never forget to enableUpdates for the query:

defer { query.enableUpdates() }
// Do stuff.

Secondly, for x in y where condition loops:

for iCloudEvent in document.data {
  // I know, I know, worst sync ever; I will try to improve it at some point.
  for localEvent in Events where localEvent.name == iCloudEvent.name {
    // Update local events.
  // Append to local events.
Subscribe to my monthly newsletter.
No spam, unsubscribe at any time.