I definitely second the answer before me.
In order to make it more realistic here is my implementation of the animation:
if let cell = tableView.cellForRow(at: IndexPath(row: 0, section: 0))
{
let favouriteView = createFakeFavouriteAction(frame: cell.frame)
tableView.insertSubview(favouriteView, belowSubview: cell)
CATransaction.begin()
let animation = CABasicAnimation(keyPath: "position")
animation.duration = 0.08
animation.repeatCount = 1
animation.autoreverses = true
animation.speed = 0.3
let fromPoint: CGPoint = CGPoint(x: cell.center.x, y: cell.center.y)
animation.fromValue = NSValue(cgPoint: fromPoint)
let toPoint: CGPoint = CGPoint(x: cell.center.x - 75, y: cell.center.y)
animation.toValue = NSValue(cgPoint: toPoint)
CATransaction.setCompletionBlock {
favouriteView.removeFromSuperview()
}
cell.setEditing(true, animated: true)
cell.layer.add(animation, forKey: "position")
}
Now, I can imagine if you have more than one UITableViewRowAction then you want to add more than one view under your cell and you want to animate those as well. My implementation is just a simple way of letting users know this cell is swipeable.