Skip to content

aimalygin/StableCollectionViewLayout

Repository files navigation

StableCollectionViewLayout

This layout adjusts a content offset if the collection view is updated. You can insert, delete or reload items and StableCollectionViewLayout will take care of the content offset.

Like this

stable

Demo

Demo

Usage

You should just create and pass StableCollectionViewFlowLayout to UICollectionView init

import StableCollectionViewLayout

UICollectionView(frame: .zero, collectionViewLayout: StableCollectionViewFlowLayout())

Also, you can create the own subclass of StableCollectionViewLayout and use it.

About

UICollectionViewLayout adjusts a content offset if the collection view is updated

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors