iOS Swift:UIPageViewController - 以编程方式翻页 [英] iOS Swift: UIPageViewController - Turning page programatically

查看:65
本文介绍了iOS Swift:UIPageViewController - 以编程方式翻页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UIPageViewController,当我们向左或向右滑动翻页时工作正常。

I have a UIPageViewController, which works fine when we swipe left or right to turn pages.

class ViewController: UIViewController, UIPageViewControllerDataSource {
...
}

现在我打算提供Previous /页面上的下一个按钮,也可以通过单击这些按钮来翻页。

Now i intend to provide Previous/Next button on the page too, so that pages can be turned by clicking on these buttons.

如何触发向左/向右滑动或以编程方式翻页?

How can i trigger the swipe left/right behaviour OR turn pages programatically?

注意
这是SWIFT语言的问题,而不是Objective-C。

NOTE This is a question for SWIFT language, not Objective-C.

推荐答案

使用此功能并为所需动画设置过渡样式。

Use this funtion and set the transition style for the animation you want.

这篇关于iOS Swift:UIPageViewController - 以编程方式翻页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆