The table delegate method is -tableView:canPerformAction:forRowAtIndexPath:withSender:designed for this purpose.
Here is an example:
override func tableView(tableView: UITableView, canPerformAction action: Selector, forRowAtIndexPath indexPath: NSIndexPath, withSender sender: AnyObject?) -> Bool {
switch action {
case Selector("cut:"), Selector("copy:"), Selector("paste:"):
return false
case Selector("myAction:"):
return true
default:
return false
}
}
source
share