aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/SwiftBuildTest/main.swift
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-04-16 13:50:11 -0700
committerGravatar GitHub <noreply@github.com>2018-04-16 13:50:11 -0700
commita25d05487435d397f3b8cd399ee8355eae497f0d (patch)
tree323b23f9ad4849093f2dbb53c8ebece59f0bd870 /Firestore/Example/SwiftBuildTest/main.swift
parent0ac71f294ffedc8c6a3fb93e18253ee25624ec00 (diff)
Replace the `SnapshotOptions` object with the behavior enum. (#1109)
Instead of calling `get(field, SnapshotOptions.serverTimestampBehavior(.estimate))` call `get(field, serverTimestampBehavior: .estimate)`
Diffstat (limited to 'Firestore/Example/SwiftBuildTest/main.swift')
-rw-r--r--Firestore/Example/SwiftBuildTest/main.swift6
1 files changed, 3 insertions, 3 deletions
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())")