Skip to content

Instantly share code, notes, and snippets.

@Prasad9
Last active August 21, 2016 12:15
Show Gist options
  • Save Prasad9/0db402b712c94584c395ca0b16b7243e to your computer and use it in GitHub Desktop.
Save Prasad9/0db402b712c94584c395ca0b16b7243e to your computer and use it in GitHub Desktop.
Swift code for listening to nodes in Firebase
let questionListenerFirebaseRef = FIRDatabase.database().reference().child(<your_channel_name>)
questionListenerFirebaseRef.observeEventType(FIRDataEventType.ChildAdded) { (dataSnapshot: FIRDataSnapshot) in
// Question added. Proceed accordingly.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment