Skip to content

Commit c2aa45c

Browse files
committed
Call CollectionViewSectionedDataSource.moveItem if it exists.
1 parent df9f56d commit c2aa45c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/DataSources/CollectionViewSectionedDataSource.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,11 @@ public class CollectionViewSectionedDataSource<S: SectionModelType>
204204
}
205205

206206
override func _rx_collectionView(collectionView: UICollectionView, moveItemAtIndexPath sourceIndexPath: NSIndexPath, toIndexPath destinationIndexPath: NSIndexPath) {
207-
self._sectionModels.moveFromSourceIndexPath(sourceIndexPath, destinationIndexPath: destinationIndexPath)
207+
if self.moveItem != nil {
208+
self.moveItem!(self, sourceIndexPath: sourceIndexPath, destinationIndexPath: destinationIndexPath)
209+
} else {
210+
self._sectionModels.moveFromSourceIndexPath(sourceIndexPath, destinationIndexPath: destinationIndexPath)
211+
}
208212
}
209213

210214
}

0 commit comments

Comments
 (0)