SwiftReorder
SwiftReorder copied to clipboard
proposedNewDestinationRow()
Hi, I dont know why need to + 5pixel in here `let visibleCells = tableView.visibleCells.filter { // Workaround for an iOS 11 bug.
// When adding a row using UITableView.insertRows(...), if the new
// row's frame will be partially or fully outside the table view's
// bounds, and the new row is not the first row in the table view,
// it's inserted without animation.
let cellOverlapsTopBounds = $0.frame.minY < tableView.bounds.minY **+ 5**
let cellIsFirstCell = tableView.indexPath(for: $0) == IndexPath(row: 0, section: 0)
return !cellOverlapsTopBounds || cellIsFirstCell
}`
It creates a crash when I have 2 section, section 0 is empty, section 1 have 2 rows and visibleCells only have a cell at Index(1, 2)