From d6867ea2016c016a89743194682ec1a6279a949f Mon Sep 17 00:00:00 2001 From: Lalit Sahoo Date: Thu, 19 Nov 2020 21:35:21 +0530 Subject: [PATCH] Capability to deselect table view row item --- CardParts/src/Classes/Card Parts/CardPartTableView.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CardParts/src/Classes/Card Parts/CardPartTableView.swift b/CardParts/src/Classes/Card Parts/CardPartTableView.swift index b97bad8b..71a2a15d 100644 --- a/CardParts/src/Classes/Card Parts/CardPartTableView.swift +++ b/CardParts/src/Classes/Card Parts/CardPartTableView.swift @@ -35,6 +35,7 @@ private class SelfSizingTableView: UITableView { @objc public protocol CardPartTableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) + @objc optional func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) @objc optional func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat } @@ -90,4 +91,8 @@ public class CardPartTableView : UIView, CardPartView, UITableViewDelegate { public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { delegate?.tableView(tableView, didSelectRowAt: indexPath) } + + public func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) { + delegate?.tableView?(tableView, didDeselectRowAt: indexPath) + } }