When customizing a Navigationcontroller implementation full-screen right-click Return, it is not very cool to use, the code is as follows:
-(void) viewdidload { [super viewdidload]; Uigesturerecognizer *gester = Self.interactivepopgesturerecognizer;
*pangester = [[Uipangesturerecognizer alloc] Initwithtarget:gester. Delegate action:nsselectorfromstring (@ "handlenavigationtransition:")];
[Gester.view Addgesturerecognizer:pangester];
= YES;
Pangester. delegate = self ;}
-(BOOL) Gesturerecognizershouldbegin: (Uigesturerecognizer *) gesturerecognizer{
if (Self.childViewControllers.count = = 1) {
return NO;
}
return YES;
}
then goose, when you open the left in the TableView editing function found dead and alive also left row, swollen fat Four, is open posture is wrong, mgd! Or a gesture conflict?
All right, hit a breakpoint and try it! Breakpoint after found into the tableview of the editing method, into the custom Navigationcontroller Gesturerecognizershouldbegin method, the original was intercepted. Then judge whether it is left or right, if left row will not intercept, give tableview to respond! The code is as follows:
-(BOOL) Gesturerecognizershouldbegin: (Uigesturerecognizer *) gesturerecognizer{if([Gesturerecognizer Iskindofclass:[uipangesturerecognizerclass]]) { if(Self.childViewControllers.count = =1 ) { returnNO; } if(Self.interactivepopgesturerecognizer &&[[Self.interactivePopGestureRecognizer.view gesturerecognizers] containsobject:gesturerecognizer]) {Cgpoint Tpoint= [(Uipangesturerecognizer *) Gesturerecognizer TranslationInView:gestureRecognizer.view]; if(Tpoint.x >=0) {CGFloat y=fabs (TPOINT.Y); CGFloat x=fabs (tpoint.x); CGFloat af=30.0f/180.0f*M_pi; CGFloat TF=TANF (AF); if((y/x) <=TF) { returnYES; } returnNO; }Else{ returnNO; } } } returnYES;}
It seems to be possible! Oh yes!
But if TableView also has a right stroke ...
The most detailed iOS event delivery and response mechanism in history-principle
iOS custom full screen return with TableView left stroke Delete gesture conflict resolution