allaboutapps / DataSource

Simplifies the setup of UITableView data sources using type-safe descriptors for cells and sections. Animated diffing built-in.
MIT License
74 stars 10 forks source link

Bug - TrailingSwipeAction + SeparatedSection leads to 'Fatal error: Index out of range' #28

Closed MSWagner closed 4 years ago

MSWagner commented 4 years ago

To reproduce this kind of error, add the following code to the datasource of the SeparatedSectionViewController (Example project) and try to swipe the last cell of the section:

.canEdit { [weak self] (_, _) -> Bool in
    return true
}
.trailingSwipeAction { [weak self] (_, _) -> UISwipeActionsConfiguration? in
    return UISwipeActionsConfiguration(actions: [
        UIContextualAction(style: .destructive, title: "Delete", handler: { [weak self] (_, _, callback) in
            callback(true)
        })
    ])
},