UIPageViewController embedded in UIScrollView ignores the first pan gesture on its pages

I have a UIPageViewController embedded in a UIScrollView and each page has a drawing view with a UIPanGestureRecognizer to free-draw. With this setup, the 1st time I attempt to draw, the pan gesture is ignored. It works the 2nd time I perform the gesture.

In my case I need to wrap the UIPageViewController in a UIScrollView to have a pull to refresh mechanism (set thescrollView.refreshControl).

I’ve tried every combination of UIGestureRecognizerDelegate methods (shouldRecognizeSimultaneously…, require(toFail:), etc.) with no luck.

This is my view hierarchy:

ScrollView
    |- UIPageViewController
        |- Page 1
        |      |- DrawingView with UIPanGestureRecognizer
        |- Page 2
               |- DrawingView with UIPanGestureRecognizer

Is this a known limitation when a UIPageViewController is nested inside another scroll view?

Reproduction steps (tested on iOS 18.4 / Xcode 16.3, iPhone 16 Pro)

  1. Launch the app; the first page shows a white canvas in the bottom part.
  2. Try to draw immediately → nothing happens.
  3. Lift your finger and draw again → works.

Here is a link for the sample project with the reproducible code: https://github.com/marcod-storyteller/page-controller-sample

P.S: If the UIPageViewController has a .pageCurl transition style instead, the problem disappears.

Instead of a ScrollView + UIPageViewController, have you tried using a UICollectionView with paging instead?

Yes I have tested it and the 1st pan gesture on the child view is detected correctly both using just a UICollectionView or a UICollectionView embedded within a UIScrollView.

However, our screen is already quite complex and built around a UIPageViewController so we have been trying to avoid switching to a UICollectionView at this point and we were more looking into a solution that preserves the UIPageViewController.

UIPageViewController embedded in UIScrollView ignores the first pan gesture on its pages
 
 
Q