ra1028 / RAReorderableLayout

A UICollectionView layout whitch can move item with drag and drop.
MIT License
867 stars 140 forks source link

Haptic feedback for 3D touch enabled devices #56

Open stasix opened 7 years ago

stasix commented 7 years ago

It there an option to add 3D touch feedback on drag and drop?

ThuggishNuggets commented 7 years ago

Yes, but you will have to override the RAReorderableLayoutDelegate methods and add the Haptic feedback yourself.

You could use any of these to hook in and perform the haptic feedback where it feels best to you:

    func collectionView(_ collectionView: UICollectionView, at: IndexPath, willMoveTo toIndexPath: IndexPath)
    func collectionView(_ collectionView: UICollectionView, at: IndexPath, didMoveTo toIndexPath: IndexPath)

    func collectionView(_ collectionView: UICollectionView, collectionView layout: RAReorderableLayout, willBeginDraggingItemAt indexPath: IndexPath)
    func collectionView(_ collectionView: UICollectionView, collectionView layout: RAReorderableLayout, didBeginDraggingItemAt indexPath: IndexPath)
    func collectionView(_ collectionView: UICollectionView, collectionView layout: RAReorderableLayout, willEndDraggingItemTo indexPath: IndexPath)
    func collectionView(_ collectionView: UICollectionView, collectionView layout: RAReorderableLayout, didEndDraggingItemTo indexPath: IndexPath)