これが、垂直セルベースのページングのためのSwift 5での私の実装です。
override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint {
    guard let collectionView = self.collectionView else {
        let latestOffset = super.targetContentOffset(forProposedContentOffset: proposedContentOffset, withScrollingVelocity: velocity)
        return latestOffset
    }
    // Page height used for estimating and calculating paging.
    let pageHeight = self.itemSize.height + self.minimumLineSpacing
    // Make an estimation of the current page position.
    let approximatePage = collectionView.contentOffset.y/pageHeight
    // Determine the current page based on velocity.
    let currentPage = velocity.y == 0 ? round(approximatePage) : (velocity.y < 0.0 ? floor(approximatePage) : ceil(approximatePage))
    // Create custom flickVelocity.
    let flickVelocity = velocity.y * 0.3
    // Check how many pages the user flicked, if <= 1 then flickedPages should return 0.
    let flickedPages = (abs(round(flickVelocity)) <= 1) ? 0 : round(flickVelocity)
    let newVerticalOffset = ((currentPage + flickedPages) * pageHeight) - collectionView.contentInset.top
    return CGPoint(x: proposedContentOffset.x, y: newVerticalOffset)
}
いくつかのメモ:
- グリッチはありません
 
- ページングをFALSEに設定ください!(それ以外の場合、これは機能しません)
 
- 独自のフリック速度を設定できます簡単。
 
- これを試してもまだ機能しない場合は
itemSize、特に使用時に問題になることが多いので、実際にアイテムのサイズと一致しているかどうかを確認してください。collectionView(_:layout:sizeForItemAt:)使用する場合は、代わりにitemSizeでカスタム変数を使用してください。 
- これは、を設定し
self.collectionView.decelerationRate = UIScrollView.DecelerationRate.fastたときに最適に機能します。 
以下は水平バージョンです(十分にテストされていないため、間違いを許してください)。
override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint {
    guard let collectionView = self.collectionView else {
        let latestOffset = super.targetContentOffset(forProposedContentOffset: proposedContentOffset, withScrollingVelocity: velocity)
        return latestOffset
    }
    // Page width used for estimating and calculating paging.
    let pageWidth = self.itemSize.width + self.minimumInteritemSpacing
    // Make an estimation of the current page position.
    let approximatePage = collectionView.contentOffset.x/pageWidth
    // Determine the current page based on velocity.
    let currentPage = velocity.x == 0 ? round(approximatePage) : (velocity.x < 0.0 ? floor(approximatePage) : ceil(approximatePage))
    // Create custom flickVelocity.
    let flickVelocity = velocity.x * 0.3
    // Check how many pages the user flicked, if <= 1 then flickedPages should return 0.
    let flickedPages = (abs(round(flickVelocity)) <= 1) ? 0 : round(flickVelocity)
    // Calculate newHorizontalOffset.
    let newHorizontalOffset = ((currentPage + flickedPages) * pageWidth) - collectionView.contentInset.left
    return CGPoint(x: newHorizontalOffset, y: proposedContentOffset.y)
}
このコードは私の個人的なプロジェクトで使用するコードに基づいています。コードをダウンロードして、サンプルターゲットを実行することで、ここで確認できます。