在另一个视图中基本拖放uitableview单元格

时间:2014-12-09 13:11:37

标签: ios drag-and-drop

我只想在任何uiview中拖动tableview然后调用一个Web服务。 请帮帮我。如果可能的话,我想在桌面视图上长按一下。

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];

   }

0 个答案:

没有答案