1

I have a custom scroll view that works well before iOS 13 that uses UIPanGestureRecognizer:

    _panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
    _panRecognizer.delegate = self;

- (void)handlePan:(UIGestureRecognizer *)gestureRecognizer
{
    UIPanGestureRecognizer* pgr = (UIPanGestureRecognizer*)gestureRecognizer;
    if (pgr.state == UIGestureRecognizerStateChanged) {
        // do something
    }
}

Now it didn't work well with iOS 13. The handlePan function does not get called anymore until 3 fingers are panning together. In iOS 12, this function will be called when just 1 finger is moved.

I have tried setting the min/maximumNumberOfTouches but not working. Is there anything changed?

OMGPOP
  • 1,995
  • 8
  • 52
  • 95
  • 1
    What is “a custom scroll view”? Where’s the reproducible code? – matt Jul 07 '19 at 01:24
  • 1
    any luck? there are new selection/undo gestures in iOS13 could well be to do with that check out https://developer.apple.com/videos/play/wwdc2019/224/ – glotcha Jul 11 '19 at 01:25
  • For me the gesture recognizer translation property returns incorrect values. (x: 0, y:0). Worked fine in iOS12. Fiddled with most things I could find: shouldRecognizeSimultaneouslyWith, max/min number of touches, etc. The pan event fires off fine, but the translation values are 0,0. Don't know how to get the proper values from the recognizer itself once it fires its event. – FranticRock Oct 08 '19 at 00:51
  • I figured out my issue. I was setting .center = someValue while at the same time having constraints on my view. iOS12 used to allow that. iOS13 no longer does, it appears. I removed ALL constraints from my view and its subviews and the view moves now with the pan gesture recognizer events. Now I'm going to start adding them back in to see if any of them will work with manual frame setting... Looks like they tightened things down with Frames + Constraints. I might have to set everything manually now, and not use any constraints, or translate everything to the constraint system. – FranticRock Oct 08 '19 at 01:11
  • Would please help me and look at my question too if you solve this problem please ?stackoverflow.com/questions/58609831/… Thank you very much – neda Derakhshesh Oct 29 '19 at 15:08
  • @FranticRock Would please help me and look at my question too if you solve this problem please ?stackoverflow.com/questions/58609831/… Thank you very much – neda Derakhshesh Oct 29 '19 at 15:08
  • Look at my question please. https://stackoverflow.com/questions/62019991 UISwipeGestureRecognizer behaves different on iOS 13 Thank you. – Vladislav Jun 01 '20 at 12:49

1 Answers1

3

It sounds like your gesture is now competing with a system gesture. Did you check the .gestureRecognizers property of the view to see if something changed?

You might have to implement gestureRecognizer(_:shouldRecognizeSimultaneouslyWith:) delegate method, by default it returns false.

glotcha
  • 558
  • 6
  • 13
  • I had to change that to true in order to make 3 touches recogniser working again in iOS 13. – nontomatic Sep 22 '19 at 12:09
  • Would please help me and look at my question too if you solve this problem please ?stackoverflow.com/questions/58609831/… Thank you very much @nontomatic – neda Derakhshesh Oct 29 '19 at 15:08