如何使用 Xcode/Swift 创建横跨屏幕的横幅图像?

How to create banner images that pan across screen using Xcode/Swift?

你如何创建一个横幅(比如,在 UITableView 或其他东西上方)在给定时间后或滑动时切换图像。然后它会在一定数量的图像后循环使用。请参阅下面提供的来自 IF 应用程序的示例)。

此外,我不一定要在这里寻找代码,而只是 Xcode 的一般功能,我会用它来实现它(即 UIImageViewContainerView使用手势识别器或其他东西)。有什么想法吗?

这是第一张图片:

那么转场开始:

然后第二张图片到位:

This is an example of how to get that exact behavior using UIPageViewController. From the documenation:

A page view controller lets the user navigate between pages of content, where each page is managed by its own view controller object. Navigation can be controlled programmatically by your app or directly by the user using gestures. When navigating from page to page, the page view controller uses the transition that you specify to animate the change.