The system comes with gestures that are Uiscreenedgepangesturerecognizer type objects, screen edge swipe gestures
Navigation Controller Full Screen swipe note points:
1. Disable the system from using sliding gestures.
2. Only the non-root controller of the navigation controller needs to trigger gestures, use gesture proxies, and control gesture triggering.
Full-screen Slide code implementation
- (void) viewdidload { [super viewdidload]; // Get the target object with sliding gestures from the system id target = self.interactivepopgesturerecognizer.delegate; // Create a full-screen swipe gesture, The action method of the target that calls the system with the swipe gesture uipangesturerecognizer *pan = [[ Uipangesturerecognizer alloc] initwithtarget:target action: @selector (handlenavigationtransition :)]; // set gesture proxy, intercept gesture trigger pan.delegate = self; // Add full-screen swipe gesture to the view of the navigation controller [self.view addgesturerecognizer:pan] ; // Disable the use of the system's own sliding gestures Self.interactivepopgesturerecognizer.enabled = no;} When to call: The agent is asked before each trigger gesture, whether it is triggered. Action: Intercept gesture Trigger- (BOOL) Gesturerecognizershouldbegin: (uigesturerecognizer *) gesturerecognizer{ // NoteMeaning: Only the non-root controller has the sliding return function, the root controller does not. // determine if the navigation controller has only one sub-controller, if there is only one child controller, it must be the root controller if ( SELF.CHILDVIEWCONTROLLERS.COUNT == 1) { // Indicates that the user does not need to trigger a swipe gesture on the root controller interface, return no; } return yes;}
Slide Full Screen