Full Screen swipe

Source: Internet
Author: User

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

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.