Ios 向UIPageViewController添加垂直滑动

Ios 向UIPageViewController添加垂直滑动,ios,uipageviewcontroller,Ios,Uipageviewcontroller,我的UIPageViewController在3个视图控制器之间水平滑动。我想在上面添加一个垂直滑动,为导航添加一个额外的级别 然而,我还没有找到这样做的解决办法。我尝试添加一个简单的 UISwipeGestureRecognizer *gestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeHandler:)]; [gestureRecognizer setD

我的UIPageViewController在3个视图控制器之间水平滑动。我想在上面添加一个垂直滑动,为导航添加一个额外的级别

然而,我还没有找到这样做的解决办法。我尝试添加一个简单的

UISwipeGestureRecognizer *gestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeHandler:)];
[gestureRecognizer setDirection:(UISwipeGestureRecognizerDirectionUp)];
[self.view addGestureRecognizer:gestureRecognizer];
但这不起作用,因为我认为UIPageView会覆盖它


有什么解决方案吗?

我正在我的应用程序中使用pageview控制器。我添加了与您相同的代码。我的刷卡活动很好

在代码中更改这一行

[gestureRecognizer setDirection:(UISwipeGestureRecognizerDirectionUp)];

如果您正在使用故事板,本教程将非常有用