Skip to content

Instantly share code, notes, and snippets.

@ts95
Last active October 4, 2017 20:46
Show Gist options
  • Save ts95/2185bffc27ead4ba0d381a3f1c4bd46f to your computer and use it in GitHub Desktop.
Save ts95/2185bffc27ead4ba0d381a3f1c4bd46f to your computer and use it in GitHub Desktop.
let firestore = Firestore.firestore()
let ref = firestore.document("books/95-0443-843-0")
ref.getModel(FirestoreBook.self) { book, error in
guard let book = book else { return }
print("The book \(book.title) was published in \(book.year).")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment