Created
December 20, 2018 07:54
-
-
Save gwennguihal/83c53bd18c8d3e1351e8c8abe8f61cc2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SectionDescriptor: CollectionSectionDescribable { | |
| private var lineSpacing = VerticalSpace.zero | |
| private var horizontalInset: CGFloat = Inset.sectionDefault | |
| public func lineSpacing(_ value: VerticalSpace) -> SectionDescriptor { | |
| lineSpacing = value | |
| return self | |
| } | |
| public func horizontalInset(_ value: Inset) -> SectionDescriptor { | |
| horizontalInset = value | |
| return self | |
| } | |
| public func sectionInset(_ collectionView: UICollectionView) -> UIEdgeInsets { | |
| return UIEdgeInsets(top: 0, left: horizontalInset, bottom: 0, right: horizontalInset) | |
| } | |
| public func minimumLineSpacing(_ collectionView: UICollectionView, layout: UICollectionViewFlowLayout) -> CGFloat { | |
| return lineSpacing | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment