Reputation: 256
i have problems / understanding troubles with multiple UITableViews in one ViewController ...
I have 4 UItableviews. So i created foreach a:
NSObjet<TableViewDelegate/Source>
Then i created in the ViewController a UILongPressGestureRecognizer
-Action and get the item i selected and hold to drag it into a other UITableView
Works fine, i get my cell but how can i hold it? And is there a way to find out in which tableview i drop the UITableViewCell?
SOLVED SPECIAL THANKS TO user1966730 (Kristof)
My new UIVIEW.h:
@interface MovingCell : UIView
@property(strong,nonatomic)UIImageView *imageViewCell;
@property(strong,nonatomic)UITableViewCell *cell; //This should be later my Custom Cell
@property(strong,nonatomic)NSIndexPath *indexPath;
@property(strong,nonatomic)UITableView* tableView;
-(void)displayCell:(UITableViewCell *)cell inView:(UIView *)mainView;
-(void)bringViewOverSelectedCell:(UIView *)mainView;
@end
UIVIEW.m:
#import "MovingCell.h"
#import <QuartzCore/QuartzCore.h>
#define _Shadow_Space_Height 7.0f
#define _Shadow_Space_Width 7.0f
@implementation MovingCell
@synthesize imageViewCell = _imageViewCell;
@synthesize cell = _cell;
-(void)displayCell:(UITableViewCell *)cell inView:(UIView *)mainView{
self.cell = cell;
//Screenshot of touchedCell
UIGraphicsBeginImageContext(cell.bounds.size);
[cell.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenShot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
// init imageView for cell snapshop if needed
if (_imageViewCell == nil)
{
_imageViewCell = [[UIImageView alloc] init];
[self addSubview:_imageViewCell];
}
// set current snapshot as image
[_imageViewCell setImage: screenShot];
// calculate position and frame
CGRect viewFrameInMainView = [mainView convertRect:cell.frame fromView:cell.superview];
_imageViewCell.frame = viewFrameInMainView;
viewFrameInMainView.origin.x -= _Shadow_Space_Width;
viewFrameInMainView.origin.y -= _Shadow_Space_Height;
viewFrameInMainView.size.width += _Shadow_Space_Width * 2.0f;
viewFrameInMainView.size.height += _Shadow_Space_Height * 2.0f;
self.frame = viewFrameInMainView;
// set write frames for subviews
_imageViewCell.frame = CGRectMake(_Shadow_Space_Width, _Shadow_Space_Height, _imageViewCell.frame.size.width, _imageViewCell.frame.size.height);
self.clipsToBounds = YES;
[mainView addSubview:self];
}
-(void)bringViewOverSelectedCell:(UIView *)mainView{
if (self.cell == nil)
{
return;
}
// calculate position and frame
CGRect viewFrameInMainView = [mainView convertRect:self.cell.frame fromView:self.cell.superview];
viewFrameInMainView.origin.x -= _Shadow_Space_Width;
viewFrameInMainView.origin.y -= _Shadow_Space_Height;
viewFrameInMainView.size.width += _Shadow_Space_Width * 2.0f;
viewFrameInMainView.size.height += _Shadow_Space_Height * 2.0f;
self.frame = viewFrameInMainView;
}
@end
ViewController.h :
@interface MovingCellViewController : UIViewController<UITableViewDelegate,UITableViewDataSource>
{
MovingCell *_cellMoveAnimationView;
CGPoint _cellMoveLastTouchPoint;
NSIndexPath *_startIndexPath;
NSInteger _startTable;
id _selectedValue;
NSTimer *_autoScrollTimer;
}
@property(weak,nonatomic)IBOutlet UITableView *openTableView;
@property(weak,nonatomic)IBOutlet UITableView *inWorkTableView;
@property(weak,nonatomic)IBOutlet UITableView *inTestTableView;
@property(weak,nonatomic)IBOutlet UITableView *doneTableView;
@property(strong,nonatomic)NSMutableArray *dataOpenTable;
@property(strong,nonatomic)NSMutableArray *dataInWorkTable;
@property(strong,nonatomic)NSMutableArray *dataInTestTable;
@property(strong,nonatomic)NSMutableArray *dataDoneTable;
-(void)tableViewCellLongPress:(UILongPressGestureRecognizer *)gestureRecognizer;
-(void)dispatchLongPressOnCellBegan:(UILongPressGestureRecognizer *)gestureRecognizer;
-(void)dispatchLongPressOnCellChanged:(UILongPressGestureRecognizer *)gestureRecognizer;
-(void)dispatchLongPressOnCellEnded:(UILongPressGestureRecognizer *)gestureRecognizer;
-(void)dispatchLongPressOnCellCancelled:(UILongPressGestureRecognizer *)gestureRecognizer;
-(void)animatedCellAfterTouchEnd;
-(void)initArraysWithData;
ViewController.m :
#import "MovingCellViewController.h"
#import "HomeViewController.h"
@interface MovingCellViewController ()
@end
@implementation MovingCellViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.dataOpenTable = [NSMutableArray array];
self.dataInWorkTable = [NSMutableArray array];
self.dataInTestTable = [NSMutableArray array];
self.dataDoneTable = [NSMutableArray array];
[self initArraysWithData];
// Do any additional setup after loading the view.
}
-(void)initArraysWithData{
for (int i = 0; i < 5; ++i) {
[self.dataOpenTable addObject:[NSString stringWithFormat:@"US #%i",i]];
}
for (int i = 5; i < 10; ++i) {
[self.dataInWorkTable addObject:[NSString stringWithFormat:@"US #%i",i]];
}
for (int i = 10; i < 15; ++i) {
[self.dataInTestTable addObject:[NSString stringWithFormat:@"US #%i",i]];
}
for (int i = 15; i < 20; ++i) {
[self.dataDoneTable addObject:[NSString stringWithFormat:@"US #%i",i]];
}
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (self.openTableView == tableView) {
return self.dataOpenTable.count;
}
if (self.inWorkTableView == tableView) {
return self.dataInWorkTable.count;
}
if (self.inTestTableView == tableView) {
return self.dataInTestTable.count;
}
if (self.doneTableView == tableView) {
return self.dataDoneTable.count;
}
return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
if (self.openTableView == tableView) {
cell.tag = 1;
[cell.textLabel setText:[self.dataOpenTable objectAtIndex:indexPath.row]];
}
if (self.inWorkTableView == tableView) {
cell.tag = 2;
[cell.textLabel setText:[self.dataInWorkTable objectAtIndex:indexPath.row]];
}
if (self.inTestTableView == tableView) {
cell.tag = 3;
[cell.textLabel setText:[self.dataInTestTable objectAtIndex:indexPath.row]];
}
if (self.doneTableView == tableView) {
cell.tag = 4;
[cell.textLabel setText:[self.dataDoneTable objectAtIndex:indexPath.row]];
}
if ([cell.gestureRecognizers count] == 0)
{
{
UILongPressGestureRecognizer *gestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(tableViewCellLongPress:)];
[gestureRecognizer setMinimumPressDuration:0.2];
[cell addGestureRecognizer:gestureRecognizer];
}
}
return cell;
}
- (void)tableViewCellLongPress:(UILongPressGestureRecognizer *)gestureRecognizer
{
//resign first responder
[self.view endEditing:YES];
switch ([gestureRecognizer state])
{
case UIGestureRecognizerStateBegan:
{
[self dispatchLongPressOnCellBegan:gestureRecognizer];
}
break;
case UIGestureRecognizerStateChanged:
{
[self dispatchLongPressOnCellChanged:gestureRecognizer];
}
break;
case UIGestureRecognizerStateEnded:
{
[self dispatchLongPressOnCellEnded:gestureRecognizer];
}
break;
case UIGestureRecognizerStateCancelled:
case UIGestureRecognizerStateFailed:
{
[self dispatchLongPressOnCellCancelled:gestureRecognizer];
}
break;
default:
{
NSAssert(YES, @"Error: Other state is detected on the gesture recognizer of the cell: %i", [gestureRecognizer state]);
}
break;
}
}
- (void)dispatchLongPressOnCellBegan:(UILongPressGestureRecognizer *)gestureRecognizer
{
UITableViewCell *cell = (UITableViewCell *)gestureRecognizer.view;
// init if needed
if (_cellMoveAnimationView == nil)
{
_cellMoveAnimationView = [[MovingCell alloc] initWithFrame:CGRectMake(0.0f , 0.0f, 10.0f, 10.0f)];
}
if (cell.tag == 1)
{
_startIndexPath = [[self.openTableView indexPathForCell:cell] copy];
_startTable = 1;
_cellMoveAnimationView.tableView = self.openTableView;
_selectedValue = [self.dataOpenTable objectAtIndex:_startIndexPath.row];
}
if (cell.tag == 2) {
_startIndexPath = [[self.inWorkTableView indexPathForCell:cell] copy];
_cellMoveAnimationView.tableView = self.inWorkTableView;
_startTable = 2;
_selectedValue = [self.dataInWorkTable objectAtIndex:_startIndexPath.row];
}
if (cell.tag == 3) {
_startIndexPath = [[self.inTestTableView indexPathForCell:cell] copy];
_cellMoveAnimationView.tableView = self.inTestTableView;
_startTable = 3;
_selectedValue = [self.dataInTestTable objectAtIndex:_startIndexPath.row];
}
if (cell.tag == 4) {
_startIndexPath = [[self.doneTableView indexPathForCell:cell] copy];
_cellMoveAnimationView.tableView = self.doneTableView;
_startTable = 4;
_selectedValue = [self.dataDoneTable objectAtIndex:_startIndexPath.row];
}
// save start index path of this cell
_cellMoveAnimationView.hidden = NO;
_cellMoveAnimationView.alpha = 0.8f;
[_cellMoveAnimationView displayCell:cell inView:self.view];
[_cellMoveAnimationView addGestureRecognizer:gestureRecognizer];
_cellMoveLastTouchPoint = [gestureRecognizer locationInView:self.view];
cell.hidden = YES;
NSLog(@"tag of Cell : %i",cell.tag);
NSLog(@"StartIndex : %i",_startIndexPath.row);
}
- (void)dispatchLongPressOnCellChanged:(UILongPressGestureRecognizer *)gestureRecognizer
{
CGPoint touchPoint = [gestureRecognizer locationInView:self.view];
CGRect newFrame = _cellMoveAnimationView.frame;
newFrame.origin.y += touchPoint.y - _cellMoveLastTouchPoint.y;
newFrame.origin.x += touchPoint.x - _cellMoveLastTouchPoint.x;
_cellMoveLastTouchPoint = touchPoint;
_cellMoveAnimationView.frame = newFrame;
if (_cellMoveAnimationView.tableView != nil && CGRectContainsPoint(_cellMoveAnimationView.tableView.frame, touchPoint))
{
CGPoint movingCellCenterPointInTableView = [_cellMoveAnimationView.tableView convertPoint:_cellMoveAnimationView.center fromView:_cellMoveAnimationView.superview];
NSIndexPath *indexPath = [_cellMoveAnimationView.tableView indexPathForRowAtPoint:movingCellCenterPointInTableView];
// only switch the cell if auto scrolling is disabled, this fix the movement bug
[_cellMoveAnimationView.tableView moveRowAtIndexPath:[_cellMoveAnimationView.tableView indexPathForCell:_cellMoveAnimationView.cell] toIndexPath:indexPath];
}
// in table view 1?
else if (CGRectContainsPoint(self.openTableView.frame, touchPoint) && _cellMoveAnimationView.tableView == nil)
{
CGPoint movingCellCenterPointInTableView = [self.openTableView convertPoint:_cellMoveAnimationView.center fromView:_cellMoveAnimationView.superview];
NSIndexPath *indexPath = [self.openTableView indexPathForRowAtPoint:movingCellCenterPointInTableView];
if (indexPath)
{
_cellMoveAnimationView.tableView = self.openTableView;
[self.dataOpenTable insertObject:_selectedValue atIndex:indexPath.row];
[_cellMoveAnimationView.tableView beginUpdates];
[_cellMoveAnimationView.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:0];
[_cellMoveAnimationView.tableView endUpdates];
[_cellMoveAnimationView.tableView cellForRowAtIndexPath:indexPath].hidden = YES;
_cellMoveAnimationView.cell = [_cellMoveAnimationView.tableView cellForRowAtIndexPath:indexPath];
}
}
// in table view 2?
else if (CGRectContainsPoint(self.inWorkTableView.frame, touchPoint) && _cellMoveAnimationView.tableView == nil)
{
CGPoint movingCellCenterPointInTableView = [self.inWorkTableView convertPoint:_cellMoveAnimationView.center fromView:_cellMoveAnimationView.superview];
NSIndexPath *indexPath = [self.inWorkTableView indexPathForRowAtPoint:movingCellCenterPointInTableView];
if (indexPath)
{
_cellMoveAnimationView.tableView = self.inWorkTableView;
[self.dataInWorkTable insertObject:_selectedValue atIndex:indexPath.row];
[_cellMoveAnimationView.tableView beginUpdates];
[_cellMoveAnimationView.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:0];
[_cellMoveAnimationView.tableView endUpdates];
[_cellMoveAnimationView.tableView cellForRowAtIndexPath:indexPath].hidden = YES;
_cellMoveAnimationView.cell = [_cellMoveAnimationView.tableView cellForRowAtIndexPath:indexPath];
}
}
//in table view 3 ?
else if (CGRectContainsPoint(self.inTestTableView.frame, touchPoint) && _cellMoveAnimationView.tableView == nil)
{
CGPoint movingCellCenterPointInTableView = [self.inTestTableView convertPoint:_cellMoveAnimationView.center fromView:_cellMoveAnimationView.superview];
NSIndexPath *indexPath = [self.inTestTableView indexPathForRowAtPoint:movingCellCenterPointInTableView];
if (indexPath)
{
_cellMoveAnimationView.tableView = self.inTestTableView;
[self.dataInTestTable insertObject:_selectedValue atIndex:indexPath.row];
[_cellMoveAnimationView.tableView beginUpdates];
[_cellMoveAnimationView.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:0];
[_cellMoveAnimationView.tableView endUpdates];
[_cellMoveAnimationView.tableView cellForRowAtIndexPath:indexPath].hidden = YES;
_cellMoveAnimationView.cell = [_cellMoveAnimationView.tableView cellForRowAtIndexPath:indexPath];
}
}
//in table view 3 ?
else if (CGRectContainsPoint(self.doneTableView.frame, touchPoint) && _cellMoveAnimationView.tableView == nil)
{
CGPoint movingCellCenterPointInTableView = [self.doneTableView convertPoint:_cellMoveAnimationView.center fromView:_cellMoveAnimationView.superview];
NSIndexPath *indexPath = [self.doneTableView indexPathForRowAtPoint:movingCellCenterPointInTableView];
if (indexPath)
{
_cellMoveAnimationView.tableView = self.doneTableView;
[self.dataDoneTable insertObject:_selectedValue atIndex:indexPath.row];
[_cellMoveAnimationView.tableView beginUpdates];
[_cellMoveAnimationView.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:0];
[_cellMoveAnimationView.tableView endUpdates];
[_cellMoveAnimationView.tableView cellForRowAtIndexPath:indexPath].hidden = YES;
_cellMoveAnimationView.cell = [_cellMoveAnimationView.tableView cellForRowAtIndexPath:indexPath];
}
}
else if(_cellMoveAnimationView.tableView)
{
NSIndexPath *indexPath = [_cellMoveAnimationView.tableView indexPathForCell:_cellMoveAnimationView.cell];
if (indexPath)
{
if (_cellMoveAnimationView.tableView == self.openTableView)
{
[self.dataOpenTable removeObject:_selectedValue];
}
if (_cellMoveAnimationView.tableView == self.inWorkTableView)
{
[self.dataInWorkTable removeObject:_selectedValue];
}
if (_cellMoveAnimationView.tableView == self.inTestTableView)
{
[self.dataInTestTable removeObject:_selectedValue];
}
if (_cellMoveAnimationView.tableView == self.doneTableView)
{
[self.dataDoneTable removeObject:_selectedValue];
}
[_cellMoveAnimationView.tableView beginUpdates];
[_cellMoveAnimationView.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
[_cellMoveAnimationView.tableView endUpdates];
_cellMoveAnimationView.tableView = nil;
}
}
}
- (void)dispatchLongPressOnCellEnded:(UILongPressGestureRecognizer *)gestureRecognizer
{
// if cell drop without seleceted table view
if (_cellMoveAnimationView.tableView == nil)
{
if (_startTable == 1)
{
_cellMoveAnimationView.tableView = self.openTableView;
[self.dataOpenTable insertObject:_selectedValue atIndex:_startIndexPath.row];
}
if (_startTable == 2)
{
_cellMoveAnimationView.tableView = self.inWorkTableView;
[self.dataInWorkTable insertObject:_selectedValue atIndex:_startIndexPath.row];
}
if (_startTable == 3)
{
_cellMoveAnimationView.tableView = self.inTestTableView;
[self.dataInTestTable insertObject:_selectedValue atIndex:_startIndexPath.row];
}
if (_startTable == 4)
{
_cellMoveAnimationView.tableView = self.doneTableView;
[self.dataDoneTable insertObject:_selectedValue atIndex:_startIndexPath.row];
}
[_cellMoveAnimationView.tableView beginUpdates];
[_cellMoveAnimationView.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:_startIndexPath] withRowAnimation:0];
[_cellMoveAnimationView.tableView endUpdates];
[_cellMoveAnimationView.tableView cellForRowAtIndexPath:_startIndexPath].hidden = YES;
_cellMoveAnimationView.cell = [_cellMoveAnimationView.tableView cellForRowAtIndexPath:_startIndexPath];
}
[_cellMoveAnimationView.cell addGestureRecognizer:gestureRecognizer];
// first animation will set the alpha back to 1.0f and bring the moving cell view over the cell in the tableview where it will drop
// second animation will hide the moving cell view with alpha 0.0f and will show the cell in the table view
// on completion the logic for the change will be set
[UIView animateWithDuration:0.3 animations:^{
//////// FIRST ANIMATION
_cellMoveAnimationView.alpha = 1.0f;
[_cellMoveAnimationView bringViewOverSelectedCell:self.view];
} completion:^(BOOL finished) {
/////// FIRST ANIMATION COMPLETION
[UIView animateWithDuration:0.2 animations:^{
///////// SECOND ANIMATION
_cellMoveAnimationView.cell.hidden = NO;
_cellMoveAnimationView.alpha = 0.0f;
} completion:^(BOOL finished) {
///////// SECOND ANIMATION COMPLETION
[_cellMoveAnimationView setHidden:YES];
_cellMoveAnimationView.cell.hidden = NO;
// index from start has changed and will never us now
_startIndexPath= nil;
}];
}];
}
/**
Long Press on cell cancelled, this function will handle the action at this event
@param gestureRecognizer = sender
*/
- (void)dispatchLongPressOnCellCancelled:(UILongPressGestureRecognizer *)gestureRecognizer
{
[self dispatchLongPressOnCellEnded:gestureRecognizer];
}
-(void)animatedCellAfterTouchEnd{
}
-(IBAction)saveAndBack:(id)sender{
HomeViewController*mainView = [self.storyboard instantiateViewControllerWithIdentifier:@"Home"];
[self.navigationController pushViewController: mainView animated:YES];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
So finally im so happy about that, after 3 Days trying different thinks Kristof help me to find out the right way and i can do my work to customize this basic solution. Hope we can help other with this. :) Have a nice Weekend :)
Best regards Konstantin
Upvotes: 1
Views: 1780
Reputation: 36
Long time ago, i've worked with UITableView and custom draging, but i think there is no standard way to do this. If u drag a cell to move this cell around, u can't leave the table view.
My idea for you, think about customizing of your cell. I added a new class called MoveCellView and each cell had a long press gesture recognizer. Now, let the magic begin.
My Move Cell
#define MFCMV_SHADOW_SPACE_HEIGHT 7.0f
#define MFCMV_SHADOW_SPACE_WIDTH 7.0f
@implementation MoveCellView
@synthesize imageViewCell = _imageViewCell;
@synthesize cell = _cell;
- (void)displayCell:(UITableViewCell *)cell inView:(UIView *)mainView
{
self.cell = cell;
// init shadow view if needed with strechable image
if (_imageViewShadow == nil)
{
_imageViewShadow = [[UIImageView alloc] initWithImage:[[UIImage imageNamed:@"FormEditorCellBackgroundShadowOnMove"] stretchableImageWithLeftCapWidth:14.0f topCapHeight:14.0f]];
_imageViewCell.frame = self.bounds;
[self addSubview:_imageViewShadow];
}
// get current view snapshot form cell
UIGraphicsBeginImageContext(cell.bounds.size);
[cell.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *imageCellSnapshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
// init imageView for cell snapshop if needed
if (_imageViewCell == nil)
{
_imageViewCell = [[UIImageView alloc] init];
[self addSubview:_imageViewCell];
}
// set current snapshot as image
[_imageViewCell setImage: imageCellSnapshot];
// calculate position and frame
CGRect viewFrameInMainView = [mainView convertRect:cell.frame fromView:cell.superview];
_imageViewCell.frame = viewFrameInMainView;
viewFrameInMainView.origin.x -= MFCMV_SHADOW_SPACE_WIDTH;
viewFrameInMainView.origin.y -= MFCMV_SHADOW_SPACE_HEIGHT;
viewFrameInMainView.size.width += MFCMV_SHADOW_SPACE_WIDTH * 2.0f;
viewFrameInMainView.size.height += MFCMV_SHADOW_SPACE_HEIGHT * 2.0f;
self.frame = viewFrameInMainView;
// set write frames for subviews
_imageViewShadow.frame = self.bounds;
_imageViewCell.frame = CGRectMake(MFCMV_SHADOW_SPACE_WIDTH, MFCMV_SHADOW_SPACE_HEIGHT, _imageViewCell.frame.size.width, _imageViewCell.frame.size.height);
self.clipsToBounds = YES;
[mainView addSubview:self];
}
- (void)bringViewOverSelectedCell:(UIView *)mainView
{
if (self.cell == nil)
{
return;
}
// calculate position and frame
CGRect viewFrameInMainView = [mainView convertRect:self.cell.frame fromView:self.cell.superview];
viewFrameInMainView.origin.x -= MFCMV_SHADOW_SPACE_WIDTH;
viewFrameInMainView.origin.y -= MFCMV_SHADOW_SPACE_HEIGHT;
viewFrameInMainView.size.width += MFCMV_SHADOW_SPACE_WIDTH * 2.0f;
viewFrameInMainView.size.height += MFCMV_SHADOW_SPACE_HEIGHT * 2.0f;
self.frame = viewFrameInMainView;
}
@end
After a long press gesture was detected i moved the pressed cell to this move cell. i also moved the long pressed gesture.
- (void)dispatchLongPressOnCellBegan:(UILongPressGestureRecognizer *)gestureRecognizer
{
XLog();
UITableViewCell *cell = (UITableViewCell *)gestureRecognizer.view;
// init if needed
if (_cellMoveAnimationView == nil)
{
_cellMoveAnimationView = [[MFCellMoveView alloc] initWithFrame:CGRectMake(0.0f , 0.0f, 10.0f, 10.0f)];
}
// save start index path of this cell
_startIndexPath = [[_tableViewEditor indexPathForCell:cell] copy];
_cellMoveAnimationView.hidden = NO;
_cellMoveAnimationView.alpha = 0.8f;
[_cellMoveAnimationView displayCell:cell inView:self.view];
[_cellMoveAnimationView addGestureRecognizer:gestureRecognizer];
_cellMoveLastTouchPoint = [gestureRecognizer locationInView:self.view];
cell.hidden = YES;
}
Now your moving cell with the gesture is on the top of your view controller. So you can move this cell around. For your next step, bring the cell to an other UITableView, i have no idea, at this time. I think you must remove the cell action in the first table view, then add this action in the next table view and also add the item.
I hope i helps a little bit.
Upvotes: 2