Start where you are. Use what you have. Do what you can.

Josh's Blog.

This is What it Means

Cover Image for This is What it Means
Josh Russell
Josh Russell

Snippet

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 var syncedEntities = [Syncable]() for document in snapshot.documents { let data = document.data() guard let uidStr = data[discoverableType.uidKey] as? String, let uid = UUID(uuidString: uidStr) else { logger.warning("Invalid UID Field in fetched discoverable for uidKey: '\(discoverableType.uidKey)'") continue } let dataObject: Syncable if let existingObject = discoverableType.find(inMoc: moc, uid: uid) { dataObject = existingObject } else { dataObject = discoverableType.create(withUid: uid, moc: moc) } _ = dataObject.syncFromServer(data: data) syncedEntities.append(dataObject) }

Cover Image for City pictured from the sky


More Articles

Cover Image for The Chimney Cricket

The Chimney Cricket

Phasellus volutpat dui nec blandit tempus. In blandit massa malesuada justo ornare mollis. Ut varius sem sed semper dignissim. Nulla non magna lacus. Proin faucibus augue feugiat viverra facilisis...

Josh Russell
Josh Russell