aimalygin/StableCollectionViewLayout
UICollectionViewLayout adjusts a content offset if the collection view is updated
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.
Installation
CocoaPods
The preferred installation method is with CocoaPods. Add the following to your Podfile:
pod 'StableCollectionViewLayout', '~> 1.0.2'Carthage
For Carthage, add the following to your Cartfile:
github "aimalygin/StableCollectionViewLayout" ~> 1.0.2Swift Package Manager
To integrate using Xcode:
File -> Swift Packages -> Add Package Dependency
Enter package URL: https://github.com/aimalygin/StableCollectionViewLayout, and select the latest release.Package Metadata
Repository: aimalygin/StableCollectionViewLayout
Stars: 70
Forks: 6
Open issues: 0
Default branch: main
Primary language: swift
License: MIT
Topics: carthage, cocoapods, contentoffset, ios, spm, swift, uicollectionview, uicollectionviewlayout, uikit
README: README.md