How IOS can slide back in the entire screen

Source: Internet
Author: User

1- (void) Setupgetsinnav2 {3Uigesturerecognizer *gesture =Self.interactivepopgesturerecognizer;4gesture.enabled =NO;5UIView *gestureview =Gesture.view;6     7Uipangesturerecognizer *poprecognizer =[[Uipangesturerecognizer alloc] init];8Poprecognizer.Delegate=Self ;9Poprecognizer.maximumnumberoftouches =1;Ten [Gestureview Addgesturerecognizer:poprecognizer]; One     /** A * Gets the target array of system gestures -      */ -Nsmutablearray *_targets = [gesture Valueforkey:@"_targets"]; the     /** - * Get its unique object, we know it is a private class called Uigesturerecognizertarget, it has a property called _target -      */ -     IDGesturerecognizertarget =[_targets Firstobject]; +     /** - * Get _target:_uinavigationinteractivetransition, it has a method called Handlenavigationtransition: +      */ A     IDNavigationinteractivetransition = [Gesturerecognizertarget valueforkey:@"_target"]; at     /** - * from the front of the print, we get it from the console with its method signature.  -      */ -SEL handletransition = nsselectorfromstring (@"handlenavigationtransition:"); -     /** - * Create a gesture that is identical to the system, we only change its class to Uipangesturerecognizer in      */ - [Poprecognizer addtarget:navigationinteractivetransition action:handletransition]; to  +}
1 -(BOOL) Gesturerecognizershouldbegin: (Uigesturerecognizer *) gesturerecognizer {2     /* * 3      *  There are two conditions that do not allow gesture execution, 1, the current controller is the root controller, 2, if this push, pop animation is executing (private property)4      * / 5     return1 &&![ [Self Valueforkey:@ "_istransitioning"] boolvalue]; 6 }

Just add the top code to the global navigation controller

How IOS can slide back in the entire screen

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.