The proposed offset is where the collection view would stop without our intervention. We peek into this area by finding its centre as proposedContentOffsetCenterX and examine our currently visible cells to see which one’s centre is closer to the centre of that area.
class CenterItemPagingCollectionViewLayout: UICollectionViewFlowLayout {
private var mostRecentOffset: CGPoint = .zero {
didSet {
notifyPageChanged()