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:
- Not all areas of the actionsheet are responsive
- Clicking on a button presents a modal view, but the actionsheet does not get dismissed
- When buttons are able to be clicked, they don't highlight