Created
July 26, 2018 12:17
-
-
Save mortenbekditlevsen/1cd81bfd00636b71dbf73c365ae67617 to your computer and use it in GitHub Desktop.
This file contains 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
public extension DatabaseReference { | |
func setValue<T>(_ value: T) throws where T: Encodable { | |
let encoder = StructureEncoder() | |
self.setValue(try encoder.encode(value)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment