Guest User

Untitled

a guest
Mar 18th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. @IBAction func HandleSendButton(_ sender: Any) {
  2. let postRef = Storage.storage().reference().child("messages").child("(selectedUser).[“id”]")
  3.  
  4. let postObject = [[String:AnyObject]]() = [
  5. "From": [
  6. "uid": User.uid,
  7. "username": User.username,
  8. "photoURL": User.photoURL.absoluteString
  9. ],
  10. "Message": textView.text,
  11. "timestamp": [".sv":"timestamp"]
  12. ] as [String:Any]
  13.  
  14. postRef.setValue(postObject, withCompletionBlock: { error, ref in
  15. if error == nil {
  16. self.dismiss(animated: true, completion: nil)
  17. } else {
  18. // Handle the error
  19. }
  20. })
  21. }
Add Comment
Please, Sign In to add comment