1
테이블 뷰가 있으며 섹션 A의 행을 스 와이프하고 나면 섹션 B의 행을 선택할 때마다 섹션 A에서 스 와이프 된 행을 선택했다고 생각합니다! 나는 브레이크 포인트를 배치하여 그것이 셀이라고 생각하는지 100 % 확신하고 섹션 B의 행을 선택할 때 그것을 호출합니다.테이블 뷰에서 행을 스 와이프하고 다른 것을 클릭하면 스 와이프가 선택됩니다.
슬쩍 내 말은 손가락 하나를 일부 셀 , 좌우로 드래그 (중요하지 않음) 한 다음 놓습니다. didSelectRowAtIndexPath는 탭이 아니기 때문에 호출하지 않습니다.
예 :
내가 뭔가 잘못하고 있습니까 A.1 : didSelectRowAtIndexPath :있는 tableView indexpath의 A.1에출근 indexpath의 B.4
OS에
을 눌러 호출? 무엇이 잘못 될 수 있습니까? 특정 세포에 접촉을 처리
전체 코드 : 슬쩍 감지하고 처리 할 때
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
RDLogString(@"(%p) Received touches began", self);
moveCount = 0;
UITouch * touch = [touches anyObject];
touchBegin = [touch locationInView: nil];
[[self nextResponder] touchesBegan: touches withEvent: event];
}
- (void) touchesMoved: (NSSet * const)touches withEvent:(UIEvent * const)event {
RDLogString(@"(%p) Received touches moved", self);
moveCount++;
[[self nextResponder] touchesMoved: touches withEvent: event];
}
- (void) touchesEnded: (NSSet * const)touches withEvent:(UIEvent * const)event {
RDLogString(@"(%p) Received touches ended", self);
if(![self checkUserSwipedWithTouches: touches]){
[[self nextResponder] touchesEnded: touches withEvent: event];
}
}
- (BOOL) checkUserSwipedWithTouches: (NSSet * const) touches {
CGPoint touchEnd = [[touches anyObject] locationInView: nil];
NSInteger distance = touchBegin.x - touchEnd.x;
// This code shows an animation if the user swiped
if(distance > SWIPED_HORIZONTAL_THRESHOLD){
[self userSwipedRightToLeft: YES];
return YES;
} else if (distance < (-SWIPED_HORIZONTAL_THRESHOLD)) {
[self userSwipedRightToLeft: NO];
return YES;
}
return NO;
}
귀하의 문제가 여전히 불분명 틱입니다. 소스 코드 예제를 제공해 주시겠습니까? 또한 "스 와이프"란 무엇을 의미합니까? 선택하거나 제거한다는 의미입니까? –