Ha ii everybody i have a tableview ,when i click the cell it popups a view,its work fine for me,but my question is, i want to tap for 2 second to popup appear.that is ,if i tap the cell for 2 second then only the popup appers.Is that possible?How can i do this?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.view addSubview:MainPopupView];
//MainPopView is the popup that i want to display after2 minit
}
Thanks in advance.
Give the UILongPressGestureRecognizer a try. You can set the
minimumPressDurationto set the time for the gesture to be recognized.You can add
UILongPressGestureRecognizerto your table view cell and get the desired action.Update
Please take a look at this previous SO question How can I determine if a user has pressed on a UITableViewCell for 2 seconds?