IOS Small tip: Optimize side-slip return compatibility with ScrollView

Source: Internet
Author: User

Http://www.cocoachina.com/ios/20150909/13369.html

@ Zhou Xiwen Kevin authorized this site reproduced.

If a TableView is added to the Viewcontroller, it is very annoying to trigger the TableView to scroll up and down when the slide is returned.

by Requiregesturerecognizertofail () This method, we can deal with this problem very well.

123456789 iflet gestures = navigationController?.view.gestureRecognizers {    forrecognizer in gestures {    if recognizer.isKindOfClass(UIScreenEdgePanGestureRecognizer) {               scrollView.panGestureRecognizer.requireGestureRecognizerToFail(recognizer as! UIScreenEdgePanGestureRecognizer)               println("Require UIScreenEdgePanGestureRecognizer to failed")               break           }       }    }

IOS Small tip: Optimize side-slip return compatibility with ScrollView

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.