Merge pull request #93 from IntelBohdan/master

added: willDeselect
This commit is contained in:
Max Sokolov 2019-05-10 19:35:09 +03:00 committed by GitHub
commit 00de0cd809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -309,6 +309,14 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate {
return indexPath return indexPath
} }
open func tableView(_ tableView: UITableView, willDeselectRowAt indexPath: IndexPath) -> IndexPath? {
if hasAction(.willDeselect, atIndexPath: indexPath) {
return invoke(action: .willDeselect, cell: tableView.cellForRow(at: indexPath), indexPath: indexPath) as? IndexPath
}
return indexPath
}
// MARK: - Row editing // MARK: - Row editing
open func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { open func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
return sections[indexPath.section].rows[indexPath.row].isEditingAllowed(forIndexPath: indexPath) return sections[indexPath.section].rows[indexPath.row].isEditingAllowed(forIndexPath: indexPath)

View File

@ -69,6 +69,7 @@ public enum TableRowActionType {
case select case select
case deselect case deselect
case willSelect case willSelect
case willDeselect
case willDisplay case willDisplay
case didEndDisplaying case didEndDisplaying
case shouldHighlight case shouldHighlight