ra1028 / DiffableDataSources

💾 A library for backporting UITableView/UICollectionViewDiffableDataSource.

Home Page:https://ra1028.github.io/DiffableDataSources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken swipe actions

denis-obukhov opened this issue · comments

Checklist

  • [x ] This is not a Apple's bug.
  • [x ] Reviewed the README and documents.
  • [x ] Searched existing issues for ensure not duplicated.

Expected Behavior

trailingSwipeActionsConfigurationForRowAt is called

Current Behavior

trailingSwipeActionsConfigurationForRowAt not called

Steps to Reproduce

  1. Create table view with diffable data source
  2. Implement table view delegate's method tableView( tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath)_
    )
  3. Set data source to diffable data source and delegate to self.
  4. See that it's not called

Environments

  • version:
    0.4.0
  • Swift version:
    5.2
  • iOS version:
    14.2
  • Xcode version:
    12.2
  • Devices/Simulators:
    iPhone 7/iPhone 11 Pro
  • CocoaPods/Carthage version:
    0.4.0

@denis-obukhov quick fix for it:

class SwipeTableViewDiffableDataSource<SectionIdentifierType: Hashable, ItemIdentifierType: Hashable>: TableViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType> { override func tableView(_ tableView: UITableView, canEditRowAt: IndexPath) -> Bool { return true } }