-
Notifications
You must be signed in to change notification settings - Fork 76
Closed
Description
Hello,
When I keep dragging the card here and there without moving it down, app crash in this line
collectionView?.bringSubview(toFront: cell!)
in this method
//Define what card should we drag
fileprivate func findDraggingCellByCoordinate(_ touchCoordinate: CGPoint) {
if let indexPath = collectionView?.indexPathForItem(at: touchCoordinate) {
if indexPath.item >= index {
//top stack
draggedCellPath = IndexPath(item: index, section: 0)
initialCellCenter = collectionView?.cellForItem(at: draggedCellPath!)?.center
} else {
//bottomStack
if (index > 0 ) {
draggedCellPath = IndexPath(item: index - 1, section: 0)
}
initialCellCenter = collectionView?.cellForItem(at: draggedCellPath!)?.center
}
//workaround for fix issue with zIndex
let cell = collectionView!.cellForItem(at: draggedCellPath!)
collectionView?.bringSubview(toFront: cell!)
}
}
How to overcome this issue. Please help me.
adudenamedruby
Metadata
Metadata
Assignees
Labels
No labels