4

How to start moving after the long tap detect? long tap detect with uilongpressgesturerecognizer. My code:

`- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    flMoveRow = NO;
    [self setEditing:YES animated:YES];
    [listView reloadData];
}


- (void)longTapGesture:(UILongPressGestureRecognizer *)sender{
    if((sender.state != UIGestureRecognizerStateEnded)&&(!flMoveRow)){
        NSLog(@"==longTapGesture:");
        flMoveRow = YES;  
        [listView beginUpdates];
        NSArray *indexPaths = [[NSArray alloc] initWithObjects:indexPath, nil];
        [listView reloadRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
        [listView endUpdates];
        sender.enabled = NO;
    return;    
}

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath{
    NSLog(@"==canMoveRowAtIndexPath:%i -- %d", indexPath.row, (int)flMoveRow);
return flMoveRow;}`

break touch. Thanks.

pmk
  • 1,897
  • 2
  • 21
  • 34
icocoadev
  • 41
  • 1
  • 3

1 Answers1

19

There is a control available on cocoacontrols.com which mimics the Clear app. It is still being worked on apparently but when I downloaded it, it was still very impressive. You could either incorporate it fully in your app or use it as a starting point in your own research.

link.

Damo
  • 12,840
  • 3
  • 51
  • 62
  • If it helped then it would be nice if you accepted the answer and/or marked me up! One thing is definitely true of SO and that is if you have a low accept-rate some people are put off spending the time to formulate an answer for you :-/ – Damo Mar 01 '12 at 15:21