StickyLayout is a collection view layout that provides sticky row and column configurability.
- Configurable Sticky options.
- Pure Swift 5.
- Horizontal and vertical scrolling support.
- Row spacing and column spacing support.
- Works with every
UICollectionView
.
Using StickyLayout quick and simple. First import StickyLayout
.
import StickyLayout
You then have the option of creating an instance of StickyConfig
, where you can specify which rows/columns you want to be sticky.
let stickyConfig = StickyLayoutConfig(stickyRowsFromTop: 1,
stickyRowsFromBottom: 0,
stickyColsFromLeft: 1,
stickyColsFromRight: 0)
let layout = StickyLayout(stickyConfig: stickyConfig)
Create an instance of StickyLayout
with your StickyConfig
as a parameter, and add it to your UICollectionView
.
UICollectionView(frame: .zero, collectionViewLayout: layout)
StickyLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "StickyLayout"
If you have any suggestions or improvements please open a pull request or create an issue.
And if you found StickyLayout useful or want to show support feel free to star this repo!