Last active
October 5, 2017 06:23
-
-
Save ts95/552b353b747096d5e937d48c71041178 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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