Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delegate methods for controlling visual changes and movement of the ... #60

Closed
wants to merge 8 commits into from

Conversation

jeffdav
Copy link

@jeffdav jeffdav commented Mar 21, 2014

...current dragging item.

This adds these delegate methods (all optional):

// Called as dragging starts from animation block to allow custom visual adjustments to the view.
- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout adjustCurrentViewForDragAnimated:(UIView*)currentView;

// Called when the draggable view moves, giving the delegate a chance to control how it has moved.  Useful for restricting movement to a single direction or constraining it to a specific boundary.
- (CGPoint)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout adjustTranslation:(CGPoint)translation forDragOfCurrentView:(UIView*)currentView;

// Called as dragging ends from animation block to allow reversing the animations applied when dragging started.
- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout adjustCurrentViewForDropAnimated:(UIView*)currentView;

Not implementing any of these methods provides the default behavior as it is prior to this change.

@jeffdav
Copy link
Author

jeffdav commented Mar 21, 2014

If you don't want to take this, just let me know. Or if you'd prefer I do it in a different way. I tried to make the minimum changes to enable what I needed to do, and to follow existing coding practices in the project. I also updated the sample project with example usage behind an #ifdef guard.

@dillan
Copy link

dillan commented Apr 25, 2014

Nice work Jeff! I hope this gets merged in soon.

@jeffdav
Copy link
Author

jeffdav commented Jul 14, 2017

Well nobody seems to care, so PEACE OUT.

@jeffdav jeffdav closed this Jul 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants