Iglistkit: Sticky headers example

Created on 26 Jun 2017  路  5Comments  路  Source: Instagram/IGListKit

Create an example that uses the IGList's collection view layout's support for sticky headers

enhancement

Most helpful comment

Not up to date in the sticky header discussion, I don't think it's been mentioned before. If the layout is set to UICollectionViewFlowLayout, you can set sectionHeadersPinToVisibleBounds to the collection view it's set to support.

Adding works fine for apps supporting iOS 9.

let layout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout
if #available(iOS 9.0, *) {
    layout?.sectionHeadersPinToVisibleBounds = true
}

All 5 comments

I will update the Supplementary View example to use sticky headers

Not up to date in the sticky header discussion, I don't think it's been mentioned before. If the layout is set to UICollectionViewFlowLayout, you can set sectionHeadersPinToVisibleBounds to the collection view it's set to support.

Adding works fine for apps supporting iOS 9.

let layout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout
if #available(iOS 9.0, *) {
    layout?.sectionHeadersPinToVisibleBounds = true
}

@bogren how about iOS 8

I'm currently reading up on the discussion here, and running a few tests in the examples. There is support and here is an example not using the UICollectionViewFlowLayout property.

Maybe close this as the PR to add it to the example was closed @rnystrom ? 馃

Was this page helpful?
0 / 5 - 0 ratings