From a7d53f793e3b96adee05d1a3e2ea4859dd0d6036 Mon Sep 17 00:00:00 2001 From: Alex Nikishin Date: Wed, 10 Feb 2016 12:30:34 +0300 Subject: [PATCH 1/2] Add willSelect action --- Tablet/TableDirector.swift | 5 +++++ Tablet/Tablet.swift | 1 + 2 files changed, 6 insertions(+) diff --git a/Tablet/TableDirector.swift b/Tablet/TableDirector.swift index a88b27a..116ed75 100644 --- a/Tablet/TableDirector.swift +++ b/Tablet/TableDirector.swift @@ -157,6 +157,11 @@ public extension TableDirector { return invokeAction(.height, cell: nil, indexPath: indexPath) as? CGFloat ?? UITableViewAutomaticDimension } + func tableView(tableView: UITableView, willSelectRowAtIndexPath indexPath: NSIndexPath) -> NSIndexPath? { + + return invokeAction(.willSelect, cell: tableView.cellForRowAtIndexPath(indexPath), indexPath: indexPath) as? NSIndexPath ?? indexPath + } + func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { let cell = tableView.cellForRowAtIndexPath(indexPath) diff --git a/Tablet/Tablet.swift b/Tablet/Tablet.swift index 8b2c35e..ce40387 100644 --- a/Tablet/Tablet.swift +++ b/Tablet/Tablet.swift @@ -31,6 +31,7 @@ public enum ActionType { case click case select case deselect + case willSelect case configure case willDisplay case shouldHighlight From fd2dc07487c6b3b0aaff36f912fe02464878cb27 Mon Sep 17 00:00:00 2001 From: Alex Nikishin Date: Wed, 10 Feb 2016 12:33:51 +0300 Subject: [PATCH 2/2] Bump pod spec --- Tablet.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tablet.podspec b/Tablet.podspec index 7cc2a08..d6f53a6 100644 --- a/Tablet.podspec +++ b/Tablet.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Tablet' - s.version = '0.2.1' + s.version = '0.2.2' s.homepage = 'https://github.com/maxsokolov/tablet' s.summary = 'Powerful type-safe tool for UITableView. Swift 2.0 is required.'