Question: As illustrated, what I need to achieve is when swiping left, a button with an image shows up, the blue one, and when swiping right the green button shows up, how to do this? i use swift and xcode 6.4

This is what i tried before asking, I was able to show two options with text in the right of a cell, but i don't want that, what is needed is in the illustration, and as said, the buttons need to be images not text.

[![enter image description here](https://i.stack.imgur.com/A1T7C.png)](https://i.stack.imgur.com/A1T7C.png)

Answer: 
I could achieved the same result using the swipe gesture recognizer. Hope this would help.

1. Create a table with prototype cell.
2. Add button both on left side and right side of the cell with image for default control state (you can change the image based on the state control state).
3. Add a container view (here it is mainView)on top of the cell covering the entire cell area.
4. Create a `TableViewCustomCell` by subclassing the `UITableViewCell`
5. Change the class of the prototype cell to the custom `TableViewCustomCell`
6. Use the following code in `TableViewCustomCell`

Swift Code :

```
    import UIKit

    class TableViewCustomCell:UITableViewCell {

    @IBOutlet weak var rightButton: UIButton!
    @IBOutlet weak var leftButton: UIButton!
    @IBOutlet weak var mainView: UIView!
    @IBAction func leftButtonTap(sender: AnyObject) {
        print("leftTap")
    }

    @IBAction func rightButtonTap(sender: AnyObject) {
         print("rightTap")
    }

    override func awakeFromNib() {
        let leftSwipe = UISwipeGestureRecognizer(target: self, action:Selector("swipe:"))
        leftSwipe.direction = .Left;
        self.mainView.addGestureRecognizer(leftSwipe)

        let rightSwipe = UISwipeGestureRecognizer(target: self, action:Selector("swipe:"))
        rightSwipe.direction = .Right;
        self.mainView.addGestureRecognizer(rightSwipe)
    }

    func swipe(sender:AnyObject)
    {
        let swipeGesture:UISwipeGestureRecognizer = sender as! UISwipeGestureRecognizer
        if(swipeGesture.direction == .Left)
        {
            var frame:CGRect = self.mainView.frame;
            frame.origin.x = -self.leftButton.frame.width;
            self.mainView.frame = frame;
        }
        else if(swipeGesture.direction == .Right)
        {
            var frame:CGRect = self.mainView.frame;
            frame.origin.x = +self.rightButton.frame.width;
            self.mainView.frame = frame;
        }

    }
}

```
The overall idea is simple - your cell's content view is a `UIScrollView` with views on the sides.

However, the complete working solution is a bit complicated and probably too broad for an answer.

I would recommend you to start with an already implemented solution, e.g. [SWTableViewCell](https://github.com/CEWendel/SWTableViewCell) (but there are others) and look into the source code. Or just use it directly. Most of the solutions can be installed using `cocoapods` and they work both in Swift and Objective-C.