Skip to content

Instantly share code, notes, and snippets.

@ts95
Last active October 5, 2017 06:23
Show Gist options
  • Save ts95/552b353b747096d5e937d48c71041178 to your computer and use it in GitHub Desktop.
Save ts95/552b353b747096d5e937d48c71041178 to your computer and use it in GitHub Desktop.
struct FirestoreBook {
let documentID: String!
var isbn: String
var title: String
}
extension FirestoreBook: FirestoreModel {
init?(modelData: FirestoreModelData) {
try? self.init(
documentID: modelData.documentID,
isbn: modelData.value(forKey: "isbn"),
title: modelData.value(forKey: "title")
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment