I've stumbled across https://github.com/RxSwiftCommunity/RxDataSources/issues/359, where the table swipe actions introduced with iOS 11 don't work, unless you implement dataSource.canEditRowAtIndexPath = { datasource, index -> Bool in return true }.
... If this method is not implemented, all rows are assumed to be editable. ...
tableView(_:canMoveRowAt:)
...By default, the reordering control is shown if the data source implements the tableView(_:moveRowAt:to:) method.
The current default values require a developer using tableView(_:leadingSwipeActionsConfigurationForRowAt:)/ tableView(_:trailingSwipeActionsConfigurationForRowAt:) to explicitly return true for canEditRowAtIndexPath - which is not necessary when doing it without RxDataSources.
Therefor, both closures should return true to mimic iOS' default behavior.
I've stumbled across https://github.com/RxSwiftCommunity/RxDataSources/issues/359, where the table swipe actions introduced with iOS 11 don't work, unless you implement
dataSource.canEditRowAtIndexPath = { datasource, index -> Bool in return true }
.This issue arises from the default values set in
TableViewSectionedDataSource
: https://github.com/RxSwiftCommunity/RxDataSources/blob/e4ffaafe76f21f149c90ea5fac8255d9778beff3/Sources/RxDataSources/TableViewSectionedDataSource.swift#L40-L41Apple Docs state:
tableView(_:canEditRowAt:)
tableView(_:canMoveRowAt:)
The current default values require a developer using
tableView(_:leadingSwipeActionsConfigurationForRowAt:)
/tableView(_:trailingSwipeActionsConfigurationForRowAt:)
to explicitly returntrue
forcanEditRowAtIndexPath
- which is not necessary when doing it without RxDataSources. Therefor, both closures should returntrue
to mimic iOS' default behavior.