0
사용자 목록을 표시하는 UITableView를 사용하고 있습니다. 나는 대리자 메서드를 구현 한 :TableView editingStyleForRowAtIndexPath : UIPanGestureRecognizer에서 호출되지 않습니까?
- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
셀 왼쪽으로 스 와이프하여 사용자 레코드를 삭제하기를, 그것은 잘 작동했다,하지만 지금은 뷰에서 마우스 오른쪽 스 와이프로 돌아가려면 컨트롤러에 UIPanGestureRecognizer를 추가합니다. 이제 여기에 문제가 제대로 호출되지 않는 tableView 대리자 메서드입니다. 그래서 어떤 도움이나 제안이라도 사건을 다루는 방법에 대해 높이 평가할 것입니다.
-(void)performAction:(UIPanGestureRecognizer *)sender {
if (sender.state == UIGestureRecognizerStateChanged){
velocity = [sender velocityInView:self.view];
NSLog(@"Velocity X: %f Y: %f",velocity.x,velocity.y);
}
else if (sender.state == UIGestureRecognizerStateEnded){
BOOL isHorizentalMotion = fabs(velocity.x) > fabs(velocity.y);
BOOL isHorizentallyLeft = velocity.x < 0 ? YES : NO;
BOOL isHorizentallyRight = velocity.x > 0 ? YES : NO;
if (isHorizentalMotion && isHorizentallyRight) {
NSLog(@"RIGHT GESTURE");
[self menuClicked:nil];
}
}
}
UITapGestureRecognizer * 탭을 호출 할 필요를 구현하지이 방법
을 시도해보십시오 여기
감사
내 UIPanGestureRecognizer 조치입니다 = [[UITapGestureRecognizer alloc] initWithTarget : 자기 행동 : @selector (hideKeyboard :)]; \t tap.cancelsTouchesInView = NO; [self.view addGestureRecognizer : tap]; – OMGHaveFun