It turns out that the culprit was the following
override func setEditing(_ editing: Bool, animated: Bool) {
super.setEditing(editing, animated: animated)
if !editing {
rowSelectionState.removeAll()
loadData()
}
refreshView()
}
Specifically, the refreshView()
call, which contains a tableView.reloadData()
call, needs to be inside of the if !editing { ... }
block. If not, when a swipe action is initiated, the swipe action appears to call setEditMode(true, ...)
, thus calling tableView.reloadData()
which messes with the UISwipeActionsConfiguration
's ability to be properly displayed.
Thus the above should look like this:
override func setEditing(_ editing: Bool, animated: Bool) {
super.setEditing(editing, animated: animated)
if !editing {
rowSelectionState.removeAll()
loadData()
refreshView()
}
}