Considering that you have an instance of a UITableView
in your ViewController
, you need to do three things:
1. Assign a delegate to your instance of UITableView
:
// considerando o ViewController onde tableView foi instanciado,
// implementa UITableViewDelegate
tableView.delegate = self
2. Implement the same method you are using but without override
:
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]?
3. Assign an implementation or create an extension of UITableViewDelegate
to your class:
class ViewController: UIViewController, UITableViewDelegate {}
or
extension ViewController: UITableViewDelegate {
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
// implement me
}
References: