How add custom image to uitableview cell swipe to delete

user3742622 picture user3742622 · Mar 29, 2015 · Viewed 9k times · Source

Could you tell me, how to add custom image to delete button when swipe cell on UITableview?

Answer

dimpiax picture dimpiax · Mar 29, 2015

search you need function "editActionsForRowAtIndexPath", where you create scope of actions. You need to set UIImage to backgroundColor of UITableViewRowAction.

let someAction = UITableViewRowAction(style: .Default, title: "") { value in 
    println("button did tapped!")
}
someAction.backgroundColor = UIColor(patternImage: UIImage(named: "myImage")!)