title: Swipe to delete with multiple options
body: <p>When the user swipes a table view cell in the chat view controller I would like to offer the option to either Block and delete that user, or to only delete the chat from the user. Is there a way I can have the swipe to delete option to have both options available? Should I be adding the block user option on a different page or will there be a way to have both in the commit editingStyle function. </p>
  
  <pre><code>class Conversation {
  var key:String
  var sender:String
  var recipient:String
  var date:Date
  var recentMessage:String
  var seen:Bool
  
  init(key:String, sender: String, recipient:String, date:Date, recentMessage:String, seen:Bool) {
      self.key = key
      self.sender = sender
      self.recipient = recipient
      self.date = date
      self.recentMessage = recentMessage
      self.seen = seen
  }
  
  // Returns the UID of the conversations partner
  // i.e NOT the UID of the current user
  var partner_uid:String {
      guard let uid = Auth.auth().currentUser?.uid else { return "" }
      if sender != uid {
          return sender
      }
      return recipient
  }
  
  func printAll() {
      print("key: \(key)")
      print("sender: \(sender)")
  
      print("recentMessage: \(recentMessage)")
  }
   }
  
     class ChatsTableViewController:UIViewController, UITableViewDelegate, UITableViewDataSource {
  
  var tableView:UITableView!
  
  var conversations = [Conversation]()
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      tableView = UITableView(frame: view.bounds)
      let nib = UINib(nibName: "ChatTableViewCell", bundle: nil)
      tableView.register(nib, forCellReuseIdentifier: "chatCell")
      tableView.delegate = self
      tableView.dataSource = self
      tableView.reloadData()
  
      title = "CHAT"
      view.addSubview(tableView)
  }
  func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
      if editingStyle == .delete {
          let cell = tableView.cellForRow(at: indexPath) as! ChatTableViewCell
          let name = cell.usernameLabel.text!
  
          let actionSheet = UIAlertController(title: "Block conversation with \(name)?", message: "Further messages from \(name) will be muted.", preferredStyle: .alert)
  
          let cancelActionButton: UIAlertAction = UIAlertAction(title: "Cancel", style: .cancel) { action -&gt; Void in }
  
  
  
          actionSheet.addAction(cancelActionButton)
  
          let deleteActionButton: UIAlertAction = UIAlertAction(title: "Block", style: .destructive)
          { action -&gt; Void in
              self.muteConversation(self.conversations[indexPath.row])
          }
  
          let deleteOnlyButton: UIAlertAction = UIAlertAction(title: "Only Delete", style: .destructive)
          { action -&gt; Void in
  
  
              print("only delete selected ")
          }
  
          actionSheet.addAction(deleteActionButton)
          actionSheet.addAction(deleteOnlyButton)
          self.present(actionSheet, animated: true, completion: nil)
      }
  }
  
  func muteConversation(_ conversation:Conversation) {
      guard let user = Auth.auth().currentUser else { return }
      let ref = Database.database().reference()
  
      let obj = [
          "social/blocked/\(user.uid)/\(conversation.partner_uid)" : true,
          "social/blockedBy/\(conversation.partner_uid)/\(user.uid)" : true,
          "conversations/users/\(user.uid)/\(conversation.partner_uid)/muted": true
      ] as [String:Any]
      print("OBBJ: \(obj)")
      ref.updateChildValues(obj, withCompletionBlock: { error, ref in
          if error != nil {
              let alert = UIAlertController(title: "Error deleting conversation!", message: nil, preferredStyle: .alert)
              alert.addAction(UIAlertAction(title: "Okay", style: .default, handler: nil))
          } else {
              let alert = UIAlertController(title: "Conversation blocked!", message: nil, preferredStyle: .alert)
              alert.addAction(UIAlertAction(title: "Okay", style: .default, handler: nil))
          }
      })
  }
  </code></pre>
  
  <p>}</p>