From 83c981818b49f86a5887eab23a77446474c9a9d3 Mon Sep 17 00:00:00 2001 From: Shin Yamamoto Date: Sat, 18 Sep 2021 14:49:49 +0900 Subject: [PATCH] Use the UITableViewCell as the sourceView --- .../Sources/ViewControllers/DebugTableViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Examples/Samples/Sources/ViewControllers/DebugTableViewController.swift b/Examples/Samples/Sources/ViewControllers/DebugTableViewController.swift index b406c3af..aa43c384 100644 --- a/Examples/Samples/Sources/ViewControllers/DebugTableViewController.swift +++ b/Examples/Samples/Sources/ViewControllers/DebugTableViewController.swift @@ -255,7 +255,8 @@ extension DebugTableViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { print("DebugTableViewController -- select row \(indexPath.row)") guard let action = Command(rawValue: indexPath.row) else { return } - execute(command: action, sourceView: tableView) + let cell = tableView.cellForRow(at: indexPath) + execute(command: action, sourceView: cell ?? tableView) } func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {