2011-11-24 8 views
0

내가 내보기에 제스처의 세 가지 유형이 PinchGesture (의 tableview 내이다) : 다른 페이지 LeftSwipe로 리디렉션 : 다음 장 RightSwipe을 위해 : previos 장 스크롤 :의 tableview 내 요구 사항의 경우 어느 하나 스크롤 제스처는 테이블 뷰의 스크롤링을 포함한 다른 동작을 비활성화해야합니다. 이것이 가능합니까? 제스처에 대한 내 코드는 제스처 인식 방법을 시도 할 수라고아이폰에서 제스처를 어떻게 제한 할 수 있습니까?

-(void) handleSwipeGesture:(UISwipeGestureRecognizer*)recognizer { 


    if(![delegate.selectedChapter isEqualToString:[NSString stringWithFormat:@"%d",[DbHandler mNumberOfChaptersInBook:delegate.selectedBook]]]) { 
     // if the currentChapter is the last then do nothing 
     delegate.selectedChapter = [NSString stringWithFormat:@"%d",[delegate.selectedChapter intValue] + 1]; 
     [delegate reloadVerses]; 
     [self resetReadViewToVerse:1]; 
    } 
    return; 




} 
-(void) handleSwipeGestureleft:(UISwipeGestureRecognizer*)recognizer { 

    if(![delegate.selectedChapter isEqualToString:@"1"]) 
    { 
     delegate.selectedChapter = [NSString stringWithFormat:@"%d",[delegate.selectedChapter intValue] - 1]; 
     [delegate reloadVerses]; 
     [self resetReadViewToVerse:1]; 
    } 
    return; 


} 
-(void) longPressDetected:(UISwipeGestureRecognizer*)recognizer { 


    SearchViewController *aSecondViewController = [[SearchViewController alloc] initWithNibName:@"SearchViewController" bundle:nil]; 
    aSecondViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical; 
    [self presentModalViewController:aSecondViewController animated:YES]; 

    /*[self.navigationController pushViewController:aSecondViewController animated:YES];*/ 

    [aSecondViewController release]; 
    [UIView commitAnimations]; 

} 
+0

제스처 인식기가 자동으로 처리하지 않습니까? – Jumhyn

답변

1

이다.

if (recognizer.state==UIGestureRecognizerStateEnded) { 
    //Do your thing. 
} 

HTH.

관련 문제