Merge pull request #4 from Wisors/master

Add willSelect action
This commit is contained in:
Max Sokolov 2016-02-10 12:34:10 +03:00
commit 71fa07e680
3 changed files with 7 additions and 1 deletions

View File

@ -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.'

View File

@ -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)

View File

@ -31,6 +31,7 @@ public enum ActionType {
case click
case select
case deselect
case willSelect
case configure
case willDisplay
case shouldHighlight