Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. let ideasRef = firebase.childByAppendingPath(IdeaStructure.PATH_IDEAS)
  2. ideasRef.observeEventOfType(.Value, withBlock: { snapshot in
  3. print(snapshot.value)
  4. }, withCancelBlock: { error in
  5. print(error.description)
  6. })
  7.  
  8. let ideasRef = firebase.childByAppendingPath(IdeaStructure.PATH_IDEAS).childByAutoId()
  9. let idea = [
  10. IdeaStructure.FIELD_MESSAGE: message,
  11. IdeaStructure.FIELD_CREATOR_ID: userId,
  12. IdeaStructure.FIELD_CREATION_DATE: NSDate().formattedISO8601
  13. ]
  14. ideasRef.setValue(idea)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement