Guest User

Untitled

a guest
Jan 21st, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. "Y3keLEI354YJdaIC9te84TOflqn2" = uid of person B,
  2. "192FDACA-84C8-49E0-A740-471922CB7C7E" = postid by person A, and
  3. Joe = person A
  4.  
  5. func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> [SwipeAction]? {
  6.  
  7. guard orientation == .right else { return nil }
  8.  
  9. let delete = SwipeAction(style: .destructive, title: nil) { action, indexPath in
  10. let savedDB = Database.database().reference().child("saved")
  11. let selectedPost = self.postArray[indexPath.row]
  12. let postid = selectedPost.postid
  13. savedDB.child(?????).child(postid).removeValue()
  14. }
  15. configure(action: delete, with: .trash)
  16. return [delete]
  17. }
Add Comment
Please, Sign In to add comment