diff --git a/DraggableCollectionView.podspec b/DraggableCollectionView.podspec index 2ed2567..eda312d 100644 --- a/DraggableCollectionView.podspec +++ b/DraggableCollectionView.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "DraggableCollectionView" - s.version = "0.1.3" + s.version = "0.1.4" s.summary = "Extension for the UICollectionView and UICollectionViewLayout that allows a user to move items with drag and drop." s.homepage = "https://github.com/lognllc/DraggableCollectionView" s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/DraggableCollectionView/Helpers/LSCollectionViewHelper.m b/DraggableCollectionView/Helpers/LSCollectionViewHelper.m index 034c360..9f1d9da 100644 --- a/DraggableCollectionView/Helpers/LSCollectionViewHelper.m +++ b/DraggableCollectionView/Helpers/LSCollectionViewHelper.m @@ -70,13 +70,14 @@ - (id)initWithCollectionView:(UICollectionView *)collectionView initWithTarget:self action:@selector(handlePanGesture:)]; _panPressGestureRecognizer.delegate = self; [_collectionView addGestureRecognizer:_panPressGestureRecognizer]; - - for (UIGestureRecognizer *gestureRecognizer in _collectionView.gestureRecognizers) { - if ([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) { - [gestureRecognizer requireGestureRecognizerToFail:_longPressGestureRecognizer]; - break; - } - } + +// iOS 10 comment out to support drag and drop +// for (UIGestureRecognizer *gestureRecognizer in _collectionView.gestureRecognizers) { +// if ([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) { +// [gestureRecognizer requireGestureRecognizerToFail:_longPressGestureRecognizer]; +// break; +// } +// } [self layoutChanged]; } @@ -321,7 +322,10 @@ - (void)handleLongPressGesture:(UILongPressGestureRecognizer *)sender - (void)warpToIndexPath:(NSIndexPath *)indexPath { - if(indexPath == nil || [lastIndexPath isEqual:indexPath]) { + if( indexPath == nil + || [ lastIndexPath isEqual: indexPath ] + || indexPath.item > [ self.collectionView numberOfItemsInSection: indexPath.section ] - 1 ) + { return; } lastIndexPath = indexPath;