We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// i.e. all iOS version is work correctly func layoutSection(layoutEnvironment: NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection? { let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(1.0)) let item = NSCollectionLayoutItem(layoutSize: itemSize) let groupSize = NSCollectionLayoutSize(widthDimension: .absolute(185), heightDimension: .absolute(160)) let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item]) let section = NSCollectionLayoutSection(group: group) section.contentInsets = .init(top: 0, leading: 15, bottom: 0, trailing: 15) section.orthogonalScrollingBehavior = .continuous section.interGroupSpacing = 10 return section } // i.e. before iOS 13 is not work correctly func layoutSection_v1(layoutEnvironment: NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection? { let itemCount = items.count guard itemCount > 0 else { return nil } let itemSize = NSCollectionLayoutSize(widthDimension: .absolute(185), heightDimension: .fractionalHeight(1.0)) let item = NSCollectionLayoutItem(layoutSize: itemSize) let width = CGFloat(15 + 185 * itemCount + 10 * (itemCount - 1) + 15) let groupSize = NSCollectionLayoutSize(widthDimension: .absolute(width), heightDimension: .absolute(160)) let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item]) group.contentInsets = .init(top: 0, leading: 15, bottom: 0, trailing: 15) group.interItemSpacing = .fixed(10) let section = NSCollectionLayoutSection(group: group) section.orthogonalScrollingBehavior = .continuous section.interGroupSpacing = 0 return section }
The text was updated successfully, but these errors were encountered:
I think you need to add IBP before NS eg) IBPNSCollectionLayoutSize instead of NSCollectionLayoutSize.
IBP
NS
IBPNSCollectionLayoutSize
NSCollectionLayoutSize
Sorry, something went wrong.
@seleemdeveloper it is typealias NS* for IBP*:
No branches or pull requests
The text was updated successfully, but these errors were encountered: