0
votes

I am presenting a UIActionSheet when a user double taps my cell:

Tap Recognition in Cell Init:

UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc]
                                            initWithTarget:self 
                                             action:@selector(handleDoubleTap:)];

        [doubleTap setNumberOfTapsRequired:2];
        [self addGestureRecognizer:doubleTap];
        [doubleTap release];

Tell the delegate to handle the tap:

- (void)handleDoubleTap:(UITapGestureRecognizer *)recognizer {
    NSLog(@"double oo");
    [delegate handleDoubleTapp];
}

Now the delegate which is my UITableViewController will present the UIActionSheet:

-(void)handleDoubleTapp{

        UIActionSheet *actionSheet = [[[UIActionSheet alloc]
                                       initWithTitle:nil
                                       delegate:self
                                       cancelButtonTitle:@"Cancel"
                                       destructiveButtonTitle:nil
                                       otherButtonTitles:@"Reply", @"Retweet", @"Direct Message", nil] autorelease];    
        [actionSheet showInView:self.parentViewController.tabBarController.view];

    }   
}

My UITableViewController implements the UIActionSheet delegate methods properly.

Problems:

  1. Not all areas of the actionsheet are responsive
  2. Clicking on a button presents a modal view, but the actionsheet does not get dismissed
  3. When buttons are able to be clicked, they don't highlight
1

1 Answers

0
votes

Just as a thought: did you try unregistering the UIGestureRecognizer once the UIActionSheet is about to become visible and re-registering it when the action sheet is dismissed? Maybe the recognizer is interfering with the touches.