Created
August 11, 2017 09:17
-
-
Save phucnm/1deb4c5df2c01eddca2d72adc8cc881b 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
| func getPost(postId: String, completion:@escaping ((Post?) -> Void)) { | |
| let postRef = Database.database() | |
| .reference().child("posts").child("postId") | |
| postRef.observeSingleEvent(of: .value, with: { (snapshot) in | |
| completion(Post(snapshot: snapshot)) | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment