I have a UIPageViewController
inside a ViewController
which contains a UICollectionView
to indicate which page is on, and on didSelectItemAt
it sets the child VC to be shown.
I need to disable interactions on UICollectionView
while the page view is being touched so there will be no interruptions with the way I handle page selection.
I have tried adding a UISwipeGestureRecognizer
and using this method below:
override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
_delegate?.stopTouches()
}
到目前为止,我还没有找到一种方法。 有什么建议么?
您可以使用此扩展程序停止滑动
用法
使用委托。
https://developer.apple.com/documentation/uikit/uipageviewcontrollerdelegate
它告诉您手势何时开始和何时结束。