title: Swiping table cells to perform actions in Swift
body: <p>I am developing an application in which I have some data displayed in a table view. Each table cell should be able to be swiped to perform some actions. These actions fall into three category: Ack, Close and More. "More" category will list a number of actions as an action sheet. Here is my code (I did not implement the functionality of the code yet)</p>
  
  <pre><code>func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -&gt; [AnyObject]? {
      let ackAction:UITableViewRowAction = UITableViewRowAction(style: UITableViewRowActionStyle.Normal, title: "Ack", handler: ackAlert)
      ackAction.backgroundColor = UIColor.orangeColor()
  
      let closeAction:UITableViewRowAction = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "Close", handler: closeAlert)
      closeAction.backgroundColor = UIColor.blackColor()
  
      let moreAction:UITableViewRowAction = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "More", handler: showMoreActions)
      moreAction.backgroundColor = UIColor.cyanColor()
      return [moreAction, closeAction, ackAction]
  }
  
  func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
      // NOTHING YET
  }
  
  func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -&gt; Bool {
      return true
  }
  </code></pre>
  
  <p>However, this results in some problems and I have some questions:</p>
  
  <p>1) I am supposed to perform swipe actions from left to right. However, as I understand, this functions are supposed to perform swiping actions from right to left and therefore three buttons which are named Ack, Close and More are display in the right hand side. Is it possible to use the same swiping pattern where swiping from left to right causes these three buttons at the left side of the table cell? If yes, how?</p>
  
  <p>2) Ignoring the question 1, how can I achieve this: Each table cell should be able to be swiped from left to right as follows:</p>
  
  <p><img src="https://i.stack.imgur.com/MiU6b.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/42tX8.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/fhRV8.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/MEcgu.png" alt="enter image description here"></p>
  
  <p>When user is swiping the table cell, name of action is displayed in the background of the cell with a spesific color. When user gives up touching, responding action will be performed. I have read some documents, tutorials and guidelines, but a smooth guidance would be great!</p>