Created
April 7, 2018 15:08
-
-
Save 3257/fec0331a9c81b1d3109f297f816e7c76 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
fileprivate func writeUnicornToDatabase(_ unicorn: Unicorn) { | |
// Access the "unicorns" child reference and then access (create) a unique child reference within it and finally set its value | |
ref.child("unicorns").child(unicorn.seenAt + "\(Int(Date.timeIntervalSinceReferenceDate * 1000))").setValue(unicorn.toAnyObject()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment