Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBAction func HandleSendButton(_ sender: Any) {
- let postRef = Storage.storage().reference().child("messages").child("(selectedUser).[“id”]")
- let postObject = [[String:AnyObject]]() = [
- "From": [
- "uid": User.uid,
- "username": User.username,
- "photoURL": User.photoURL.absoluteString
- ],
- "Message": textView.text,
- "timestamp": [".sv":"timestamp"]
- ] as [String:Any]
- postRef.setValue(postObject, withCompletionBlock: { error, ref in
- if error == nil {
- self.dismiss(animated: true, completion: nil)
- } else {
- // Handle the error
- }
- })
- }
Add Comment
Please, Sign In to add comment