From a25d05487435d397f3b8cd399ee8355eae497f0d Mon Sep 17 00:00:00 2001 From: Gil Date: Mon, 16 Apr 2018 13:50:11 -0700 Subject: Replace the `SnapshotOptions` object with the behavior enum. (#1109) Instead of calling `get(field, SnapshotOptions.serverTimestampBehavior(.estimate))` call `get(field, serverTimestampBehavior: .estimate)` --- Firestore/Example/SwiftBuildTest/main.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Firestore/Example/SwiftBuildTest/main.swift') diff --git a/Firestore/Example/SwiftBuildTest/main.swift b/Firestore/Example/SwiftBuildTest/main.swift index 8de5ed4..87b6cb4 100644 --- a/Firestore/Example/SwiftBuildTest/main.swift +++ b/Firestore/Example/SwiftBuildTest/main.swift @@ -198,13 +198,13 @@ func readDocument(at docRef: DocumentReference) { if let data = document.data() { print("Read document: \(data)") } - if let data = document.data(with: SnapshotOptions.serverTimestampBehavior(.estimate)) { + if let data = document.data(with: .estimate) { print("Read document: \(data)") } if let foo = document.get("foo") { print("Field: \(foo)") } - if let foo = document.get("foo", options: SnapshotOptions.serverTimestampBehavior(.previous)) { + if let foo = document.get("foo", serverTimestampBehavior: .previous) { print("Field: \(foo)") } // Fields can also be read via subscript notation. @@ -304,7 +304,7 @@ func listenToDocuments(matching query: Query) { func listenToQueryDiffs(onQuery query: Query) { let listener = query.addSnapshotListener { snap, error in if let snap = snap { - for change in snap.documentChanges { + for change in snap.documentChanges() { switch change.type { case .added: print("New document: \(change.document.data())") -- cgit v1.2.3