                 }
                 
                 let path = IndexPath(row: rowsInSection, section: section)
-                return (path, abs(snapshotView.frame.minY - rect.maxY))
+                return (path, abs(snapshotFrame.minY - rect.maxY))
             }
             else {
                 return nil

//

import UIKit

extension ReorderController {
    

        guard case let .reordering(_, destinationRow, _) = reorderState else { return nil }
        guard let tableView = tableView, let snapshotView = snapshotView else { return nil }
        
        let snapshotFrame = CGRect(center: snapshotView.center, size: snapshotView.bounds.size)
        
        let rowSnapDistances = tableView.indexPathsForVisibleRows?.map { path -> (path: IndexPath, distance: CGFloat) in
            let rect = tableView.rectForRow(at: path)
            
            if (destinationRow as NSIndexPath).compare(path) == .orderedAscending {
                return (path, abs(snapshotFrame.maxY - rect.maxY))
            } else {
                return (path, abs(snapshotFrame.minY - rect.minY))
            }
        } ?? []
        
