Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/94.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 当用户向上滑动手势时,PageViewController中的视图控制器是否可以向上设置动画?_Ios_Swift_Viewcontroller_Uipageviewcontroller_Uiswipegesturerecognizer - Fatal编程技术网

Ios 当用户向上滑动手势时,PageViewController中的视图控制器是否可以向上设置动画?

Ios 当用户向上滑动手势时,PageViewController中的视图控制器是否可以向上设置动画?,ios,swift,viewcontroller,uipageviewcontroller,uiswipegesturerecognizer,Ios,Swift,Viewcontroller,Uipageviewcontroller,Uiswipegesturerecognizer,我有一个UIPageViewController,里面有几个视图控制器。它现在是水平滚动,我在视图中添加了一个向上滑动的手势 var swipeUp = UISwipeGestureRecognizer(target: self, action: #selector(swipeUpAction)) swipeUp.direction = .up self.view.addGestureRecognizer(swipeUp) 我想知道当用户点击这个SwipeGesture

我有一个UIPageViewController,里面有几个视图控制器。它现在是水平滚动,我在视图中添加了一个向上滑动的手势

    var swipeUp = UISwipeGestureRecognizer(target: self, action: #selector(swipeUpAction))
    swipeUp.direction = .up
    self.view.addGestureRecognizer(swipeUp)

我想知道当用户点击这个SwipeGestureRecognitor时,是否可以向上设置PageViewController中的视图控制器的动画?动画完成后,将ViewController从PageViewController中移除。

您不需要添加手势识别器,只需实现
UIPageViewController
的委托方法即可进行滑动。我已经让它使用委托方法左右滑动了。我的意思是,我希望页面能够刷起来,然后使视图控制器从UIPageViewController中完全消失,这是UX功能的一部分,可以从不同的页面视图中“选择”内容@帕布罗。