Skip to content

jeffreysfllo24/StickyLayout

Repository files navigation

StickyLayout

codecov pod Badge w/ Platform License MIT

The above examples are accessible in the example folder.

What is StickyLayout?

StickyLayout is a collection view layout that provides sticky row and column configurability.

Features

  • Configurable Sticky options.
  • Pure Swift 5.
  • Horizontal and vertical scrolling support.
  • Row spacing and column spacing support.
  • Works with every UICollectionView.

Setup

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)

Installation

StickyLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "StickyLayout"

Feedback and Suggestions

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!