하나의 셀이 전체 화면 너비를 차지하는 collectionView에서 왼쪽 또는 오른쪽으로 스 와이프 한 것을 감지하고 싶습니다. 제스처 인식기를 추가하지 않고도 수행 할 수 있습니까? 제스처 인식기를 추가하려고 시도했지만 collectionView의 scrollEnabled 속성을 NO로 설정 한 경우에만 작동합니다.UICollectionView Swipe
UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(didSwipeRight:)];
swipeRight.delegate = self;
swipeRight.numberOfTouchesRequired = 1;
[swipeRight setDirection:UISwipeGestureRecognizerDirectionRight];
UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(didSwipeLeft:)];
swipeLeft.delegate = self;
swipeLeft.numberOfTouchesRequired = 1;
[swipeLeft setDirection:UISwipeGestureRecognizerDirectionLeft];
[self.collectionView addGestureRecognizer:swipeLeft];
[self.collectionView addGestureRecognizer:swipeRight];
왜 스 와이프 제스처를 사용 하시겠습니까? –
왼쪽 또는 오른쪽으로 스 와이프 여부를 감지하는 중 일부 처리를 수행하려고합니다. – user694688
컬렉션보기가 세로 또는 가로로 스크롤합니까? 진짜 질문은 컬렉션보기에서 왼쪽/오른쪽으로 스 와이프를 감지하려고하거나 제스처 인식기가 실제로 원하지 않는다는 것입니다. –