Stable CollectionView Layout can insert, delete or reload items
  • October 12, 2023

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

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.2

Swift Package Manager

For Swift 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.

GitHub


View Github

#carthage #cocoa #cocoapod #cocoapods #cocoatouch #collection #collectionkit #collectionview #collectionviewcell #collectionviewlayout #contentoffset #customlayout #dynamic #expandabletableview #flowlayout #hashtag #hashtags #ibinspectable #instagram #instagramanimation #ios #iosanimation #iosdevelopment #iossdk #iosswift #iosthirdparty #library #lightboxalgorithm #materialdesign #objectivec #spm #swift #swiftanimation #swiftcollection #swiftimage #swiftlibrary #swiftpackagemanager #swiftui #swiftuicomponents #table #tableview #tableviewcell #taglistview #tags #tagsview #uicocoapods #uicollectionview #uicollectionviewanimation #uicollectionviewcell #uicollectionviewflowlayout #uicollectionviewlayout #uikitautolayout #uitableview #uitableviewanimation #uitableviewcell #uitableviewcontroller #xcode
YOU MIGHT ALSO LIKE...
exyte

     

camerakit-ios

CameraKit helps you add reliable camera to your app quickly. Our open source camera platform provides consistent capture results, service ...

HybridCamera

[video width="192" height="416" mp4="https://swiftgit.com/wp-content/uploads/2024/12/68747470733a2f2f7261776769742e636f6d2f7374796c656b69742f696d672f6d61737465722f7669645f6564697465645f325f326d622e676966.mp4"][/video]

TakeASelfie

An iOS framework that uses the front camera, detects your face and takes a selfie. This api opens the front ...

iOS-Depth-Sampler

Code examples of Depth APIs in iOS