Forum Xamarin Xamarin.iOS

UIPanGestureRecognizer returns null on an iPhone 6 and 6 Plus, but not on other device or simulator

jonyburjonybur ARMember ✭✭

I'm having an issue with UIPanGestureRecognizer on an iPhone 6. The following code runs well on an iPhone 5 and on the iOS simulator:

UIPanGestureRecognizer panGesture = new UIPanGestureRecognizer ((pg) => { Console.WriteLine(pg.State); });

I tried this code on an iPhone 6 and on an iPhone 6 Plus and on both pg is null when the gesture starts.

I have no idea why. I tried deleting the app, reinstalling it, rebooting the devices.

The iPhone 6 runs iOS 8.3 (12F70), as well as the iPhone 5.

On the simulator, and on the iPhone 5 the code runs perfectly.

Ideas? :)
Thank you!!


  • adamkempadamkemp USInsider, Developer Group Leader mod

    That sounds pretty crazy. Could you upload an example project showing this?

  • jonyburjonybur ARMember ✭✭

    I can't upload the project because I signed an NDA for it. I can upload the class where I'm handling the gesture recognition but it's pretty standard. The code is correct, I'm sure of it, because it works on the iPhone 5 and on the simulator (on the iPhone 6 simulator too).
    I'm trying to think about a reason why the variable "pg" equals null when the event is fired.

  • adamkempadamkemp USInsider, Developer Group Leader mod

    What about a smaller project that just does this one thing?

  • jonyburjonybur ARMember ✭✭

    I just solved the issue!!!
    I copied and pasted the solution to another folder outside the repository and everything works now. Im super confused, but it works.
    Thank you!!!

  • jonyburjonybur ARMember ✭✭

    I just encountered the same bug. It's really, really annoying and I don't know the reason behind of it. Now my issue is with UISwipeGesture, and the fix of copying and pasting the solution to another folder isn't working.
    I have no clue what this is or who am I anymore.

  • adamkempadamkemp USInsider, Developer Group Leader mod

    Again, could you post some code that reproduces it?

  • nick5454nick5454 USUniversity ✭✭✭
    edited May 2015

    i have technically the same issue. on iphone 6 only when a scrollview is present all gesture fail. i have a post regarding it on here. we basically gave up at hacking the scrollview to just please iphone 6.

    the scrollview is 3 levels below the gesture on only on iphone 6, if a scrollview is present gestures never fire. you can set scrolldisabled = false, but if a webview is present, which has a child scrollview, gestures are ignored. this work a few releases ago

    this example posted last does not have the web view added, but if i throw one it iphone 6 never sees the gesture.

  • adamkempadamkemp USInsider, Developer Group Leader mod

    That's a different issue entirely, and it's expected behavior as far as I can tell. I commented on your other post with a solution.

Sign In or Register to comment.