Reputation: 900
I am using icarousel in my iPad application. I want a functionality like drag and drop of objects in that icarousel. Drag in a view out of the carousel to delete an item from it and drop a view in the carousel to add an item to in. I have downloaded icarousel from https://github.com/nicklockwood/iCarousel
I have tried the drag and drop functionality using the delegate methods
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
but whole the view is messed up. please help me out here. thank you in advance.
Upvotes: 2
Views: 1054
Reputation: 4652
All you need can be found in this sample project: https://github.com/firdousali86/SampleDragDropCarousel
Upvotes: 0
Reputation: 2958
This is kind of an old post, but just in case you are still stuck, here is what we do.
To pull a view out:
Check the location on recognizerStateEnded
4.1 Return item if not fully out
4.2 Delete item from data source if fully out
You can do something very similar to views that you drop on the iCarousel but in reverse.
Upvotes: 3