From 14c456df22237426b32a0d07a407de2d64b23c4c Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 5 Feb 2023 14:41:10 -0500 Subject: [PATCH] Tweak trends orthogonal scroll behavior --- Tusker/Screens/Explore/TrendsViewController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tusker/Screens/Explore/TrendsViewController.swift b/Tusker/Screens/Explore/TrendsViewController.swift index 879862e8..73157e47 100644 --- a/Tusker/Screens/Explore/TrendsViewController.swift +++ b/Tusker/Screens/Explore/TrendsViewController.swift @@ -52,9 +52,9 @@ class TrendsViewController: UIViewController, CollectionViewController { let item = NSCollectionLayoutItem(layoutSize: itemSize) let groupSize = NSCollectionLayoutSize(widthDimension: .absolute(250), heightDimension: .estimated(280)) let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item]) - group.edgeSpacing = NSCollectionLayoutEdgeSpacing(leading: .fixed(8), top: nil, trailing: .fixed(8), bottom: nil) + group.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 8, bottom: 0, trailing: 8) let section = NSCollectionLayoutSection(group: group) - section.orthogonalScrollingBehavior = .continuousGroupLeadingBoundary + section.orthogonalScrollingBehavior = .groupPaging section.boundarySupplementaryItems = [ NSCollectionLayoutBoundarySupplementaryItem(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(12)), elementKind: UICollectionView.elementKindSectionHeader, alignment: .topLeading) ] @@ -66,9 +66,9 @@ class TrendsViewController: UIViewController, CollectionViewController { let item = NSCollectionLayoutItem(layoutSize: itemSize) let groupSize = NSCollectionLayoutSize(widthDimension: .absolute(350), heightDimension: .absolute(250)) let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item]) - group.edgeSpacing = NSCollectionLayoutEdgeSpacing(leading: .fixed(8), top: nil, trailing: .fixed(8), bottom: nil) + group.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 8, bottom: 0, trailing: 8) let section = NSCollectionLayoutSection(group: group) - section.orthogonalScrollingBehavior = .continuousGroupLeadingBoundary + section.orthogonalScrollingBehavior = .groupPaging section.boundarySupplementaryItems = [ NSCollectionLayoutBoundarySupplementaryItem(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .estimated(12)), elementKind: UICollectionView.elementKindSectionHeader, alignment: .topLeading) ]