ios - 使用 UIPageViewController 向左滑动返回第一页

标签 ios swift uinavigationcontroller uipageviewcontroller

我有一个继承自 UINavigationControllerGetStartedViewController

GetStartedViewController 打开应用程序的教程。 本教程是一个 UIPageViewController

问题是在 UIPageViewController 中不可能“滑回”到前一个 View ,因为它已经处理了滑动手势。用户唯一的选择是点击导航栏左上角的“后退”按钮。

关于如何实现的任何想法:

if indexScrolled == -1 {
    self.navigationController?.popViewControllerAnimated(true)
}

?

谢谢:)

最佳答案

您是否尝试将滑动手势识别器添加到您的 GetStartedViewController 中?

如果index != 0

,则在 gestureShouldStart 中分配一个委托(delegate)并返回 false

关于ios - 使用 UIPageViewController 向左滑动返回第一页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39447348/

相关文章:

使用 Cloud Functions 的 iOS 后台通知

azure - 在 iOS 上使用 Azure 移动服务框架和 swift 时出现问题 - EXC_BAD_ACCESS 将表记录保存到类属性

ios - swift - 导航 Controller 删除后退按钮箭头

ios - 从任何其他类的 Controller 中删除 View ?

ios - AVCaptureMovieFileOutput 输出文件不存在

ios - 当应用程序处于后台模式时更改 tabBar 角标(Badge) (swift ios)

swift - 你能解释/解决这些 'generic constraint' 编译器错误吗?

swift - 尝试从核心数据对象设置 UITextField 文本时在 prepareForSegue 中查找 nil

iOS 以编程方式更改 AppDelegate 中的 View

ios - 当 UNNotificationExtensionUserInteractionEnabled 为真时,如何从 UNNotificationContentExtension 触发 didReceiveRemoteNotification