Ios 其他视图中的基本拖放uitableview单元格
我只想在任何uiview中拖动tableview,然后调用一个web服务。 请帮帮我。如果可能的话,我想通过长按tableview来启用拖动Ios 其他视图中的基本拖放uitableview单元格,ios,drag-and-drop,Ios,Drag And Drop,我只想在任何uiview中拖动tableview,然后调用一个web服务。 请帮帮我。如果可能的话,我想通过长按tableview来启用拖动 in table view UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:cell action:nil]; longPress.delegate = self; [
in table view
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:cell action:nil];
longPress.delegate = self;
[cell addGestureRecognizer:longPress];
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{
if([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]){
[gestureRecognizer addTarget:self action:@selector(longGestureAction:)];
}
return YES;
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
return YES;
}
-(void)longGestureAction:(UILongPressGestureRecognizer *)gesture{
UITableViewCell *cell= (UITableViewCell *)[gesture view];
}
到目前为止你试过什么吗?Stackoverflow旨在帮助您解决特定问题,而不是为您开发应用程序。请给出基本解决方案我应该从哪里开始,我应该使用什么UILongPressGestureRecognitizer*longPress=[[UILongPressGestureRecognitizer alloc]initWithTarget:cell action:nil];longPress.delegate=self;[单元格地址识别器:longPress];有一个教程演示如何从一个表视图中的单元格拖动到另一个表视图。看起来它提供了一些类似于您希望在这里实现的功能。