ios - How to prevent scrollview in UITableView when user swipe gesture down two touches? -


I think that when user swip direction is down on UITWV, I do some stuff and not scrolling the table is. How can I do this?

If you want your UISwipeGestureRecognizer UITableView's UIPanGestureRecognizer < With / code>, you just need to set up and implement a representative of your swipe gesture

- (BOOL) Gesture: Identifier: (UIGestureRecognizer *) The gesture must be recognized with synonymsistician : (UIGestureRecognizer *) otherGestureRecognizer

then return yes .

If you want to disrupt the tableview's pan gesture, you probably can not use the UISwipeGestureRecognizer to do this, since the user actually swiped a certain distance until it Not really.

If you need it, then maybe you can use a UIPanGestureRecognizer for counterfeit behavior. I was able to get something similar:

  #pragma icon UIViewController lifecycle - (zero) viewDidoadload [[Super Viewedloadload]; UIPanGestureRecognizer * panner = [[UIPanGestureRecognizer alloc] initWithTarget: Auto Actions: @Selector (Dipan :)]; [Pager set deliget: self]; [Painter Setminman OffTouch: 2]; [Self-Televisions Ext Gesturerequiser: Pener]; } #pragma Custom Swipe Reaction Mark - (Zero) didSwipe {NSLog (@ "SWIPED!"); } #pragma mark UIPanGestureRecognizer response - (zero) didPan: (UIPanGestureRecognizer *) identifier {[self cancelGestureRecognizer: self.tableView.panGestureRecognizer]; If (recognizer.state == UIGestureRecognizerStateChanged) {CGPoint Translation = [Identifier Translation InView: self.view]; If (translate. Y> 20) {[self-naspeep]; [Self-cancellation: Protector: Identifier]; }}} #pragma mark UIGestureRecognzierDelegate implementation - (bool) gestureRecognizer: (UIGestureRecognizer *) gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer: (UIGestureRecognizer *) otherGestureRecognizer {// Note: returning yes blindly in this case is usually a bad idea. You should check the identifiers here. Yes come back } #pragma Icon UIGestureRecognizer The stuff that should be in a range and this file is not. - (empty) CancelTesterer: (UIGestureRecognizer *) identifier {if (recognizer.enabled) {[identifier set enabled: no]; [Enable identifier set: Yes]; He said, in most cases this makes it a better user experience to use only a pan gesture and to make any animation / transition / interaction based on the distance they have installed (). CGP translation is ). 


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -