이 경우 GestureRecognizer를 사용할 수 있습니다.
이 시도 :
UISwipeGestureRecognizer *gestureObj = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(Method:)];
[gestureObj setDirection:UISwipeGestureRecognizerDirectionRight];
[self.tableview addGestureRecognizer:gestureObj];
-(void)Method:(UISwipeGestureRecognizer *)gestureRecognizer {
CGPoint p = [gestureRecognizer locationInView:self.tableview];
NSIndexPath *indexPath = [self.tableview indexPathForRowAtPoint:p];
if (indexPath == nil)
{
[self setEditing:YES animated:YES];
NSLog(@"slide on table view but not on a row");
}
else
{
[self setEditing:YES animated:YES];
NSLog(@"slide on table view at row %d", indexPath.row);
}
UITableViewCell *cell = [self.MYArray objectAtIndex:indexPath.row];
}
안녕 사미르, 정확히 무슨 뜻인지 확실하지 않습니다. 내 질문을 편집했을지 모르겠다. – ceekay