Swiftpack.co -  Instagram/IGListKit as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
Instagram/IGListKit
A data-driven UICollectionView framework for building fast and flexible lists.
.package(url: "https://github.com/Instagram/IGListKit.git", from: "4.0.0")

Build Status Coverage Status Pods Version Platforms Carthage Compatible


A data-driven UICollectionView framework for building fast and flexible lists.

Main Features
๐Ÿ™… Never call performBatchUpdates(_:, completion:) or reloadData() again
๐Ÿ  Better architecture with reusable cells and components
๐Ÿ”  Create collections with multiple data types
๐Ÿ”‘ Decoupled diffing algorithm
โœ… Fully unit tested
๐Ÿ” Customize your diffing behavior for your models
๐Ÿ“ฑ Simply UICollectionView at its core
๐Ÿš€ Extendable API
๐Ÿฆ Written in Objective-C with full Swift interop support

IGListKit is built and maintained with โค๏ธ by Instagram engineering. We use the open source version master branch in the Instagram app.

Multilingual translation

Chinese README

Requirements

  • Xcode 9.0+
  • iOS 9.0+
  • tvOS 9.0+
  • macOS 10.11+ (diffing algorithm components only)
  • Interoperability with Swift 3.0+

Installation

CocoaPods

The preferred installation method is with CocoaPods. Add the following to your Podfile:

pod 'IGListKit', '~> 4.0.0'

Carthage

For Carthage, add the following to your Cartfile:

github "Instagram/IGListKit" ~> 4.0.0

For advanced usage, see our Installation Guide.

Getting Started

$ git clone https://github.com/Instagram/IGListKit.git
$ cd IGListKit/
$ ./scripts/setup.sh

Documentation

You can find the docs here. Documentation is generated with jazzy and hosted on GitHub-Pages.

To regenerate docs, run ./scripts/build_docs.sh from the root directory in the repo.

Vision

For the long-term goals and "vision" of IGListKit, please read our Vision doc.

Contributing

Please see the CONTRIBUTING file for how to help. At Instagram, we sync the open source version of IGListKit daily, so we're always testing the latest changes. But that requires all changes be thoroughly tested and follow our style guide.

We have a set of starter tasks that are great for beginners to jump in on and start contributing.

License

IGListKit is MIT-licensed.

The files in the /Examples/ directory are licensed under a separate license as specified in each file. Documentation is licensed CC-BY-4.0.

GitHub

link
Stars: 12075
Last commit: 3 days ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jackโ€™d and SCRUFF. We are two of the worldโ€™s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

4.0.0
1 year ago

4.0.0

4.0.0 is here! ๐ŸŽ‰๐ŸŽŠ๐Ÿฅณ

This version has a number of improvements we've been working on for the last year. We're excited for everyone get their hands on the new improvements and features. Thanks so much to all who contributed code, submitted issues, and contributed to discussions around this release!

Breaking Changes

  • Added Swift annotation name to IGListAdapterDelegate which removes IG prefix. The new name for Swift clients is ListAdapterDelegate. Andrea Antonioni (#1116)

  • Remove support for iOS 8 Ian Perry (#1381)

  • IGListKit has been split into IGListKit and IGListDiffKit for Xcode and Carthage builds. Cocoapods continues to use an all-inclusive IGListKit podspec. Nate Stedman (#1377)

  • Remove coalescanceTime from IGListAdapterUpdate, since it increase crash rate. Zhisheng Huang (2f76e8c)

  • All IGListBindingSectionControllerSelectionDelegate methods are now required. Bofei Zhu (#1186)

  • Renamed [IGListAdapterUpdatingDelegate listAdapterUpdater:willPerformBatchUpdatesWithCollectionView:] to [IGListAdapterUpdatingDelegate listAdapterUpdater:willPerformBatchUpdatesWithCollectionView:fromObjects:toObjects:listIndexSetResult:] to include more supporting info on updated objects. Jeremy Cohen (b200dda)

  • Renamed [IGListAdapterUpdatingDelegatelistAdapterUpdater:collectionView:willCrashWithException:fromObjects:toObjects:updates:] to [ IGListAdapterUpdatingDelegatelistAdapterUpdater:collectionView:willCrashWithException:fromObjects:toObjects:diffResult:updates:] to include diff result info. Zhisheng Huang (039e77e)

  • Remove IGListStackedSectionController. Hanton Yang (#1355)

Enhancements

  • Added IGListCollectionScrollingTraits for exposing UICollectionView scrolling traits to section controllers via IGListCollectionContext. Adam Stern (b4c8ea1)

  • IGListBindingSectionController no longer asserts when reloading the entire section. A warning message is now logged if the entire section is going to be reloaded. Jeff Bailey (#1213)

  • Added preferItemReloadsForSectionReloads in IGListAdapterUpdater so that the item updates are invoked with the proper collectionView animation, instead of using the delete+insert section operation when the number of items is unchanged. Zhisheng Huang (f699ea0)

  • Created IGListAdapterPerformanceDelegate for IGListAdapter to be able to measure how long some operations take across all section controllers. For example, how long it takes to dequeue a cell. Maxime Ollivier (4662454)

  • Update CocoaPods integration to use the CocoaPods specs CDN Koen Punt (#1386)

  • Remove useless system version code Kinarobin (#1386)

Fixes

  • Fixed bug with layouts inconsistency in updateAnimated:completion of IGListBindingSectionController. Qinghua Hong (#1285)

  • Fixed bug with -[IGListAdapter scrollToObject:supplementaryKinds:scrollDirection:scrollPosition:animated:] where the content inset(bottom/right) of the collection view was incorrectly being applied to the final offset and was inconsistent with the content inset(top/left) of the collection view being applied. Qinghua Hong (#1284)

  • Fixed crash when the data source is nil before calling -[IGListAdapterUpdater performUpdateWithCollectionViewBlock:fromObjects:toObjectsBlock:animated:objectTransitionBlock:completion:]. Zhisheng Huang (6cdd112)

  • Experimental fix to get the UICollectionView for batch updating immediately before applying the update. Ryan Nystrom (583efb9)

  • Fixed bug with IGListDiff.mm where arrays of NSIndexPath, instead of NSIndexPath, were incorrectly set as objects for the IndexPathMaps. Bofei Zhu (#1205)

  • [IGListAdapterUpdater performBatchUpdatesWithCollectionViewBlock:] and [IGListAdapterUpdater performReloadDataWithCollectionViewBlock:] clean state and run completion blocks if their UICollectionView is nil. Brandon Darin (290d592)

  • Ensuring view models with duplicate diff identifiers are removed when view models are first requested by IGListBindingSectionController Adam Stern (a1ee4c1)

  • Fixed [IGListAdapterUpdater reloadItemInCollectionView:fromIndexPath:toIndexPath:] does not call delegate when not inside a batch update. Bofei Zhu (#1211)

  • Log instead of assert for duplicate diff identifiers to make code testable. Adam Stern (bee2178)

  • Removed nibName argument from IGListReusableViewIdentifier. Trung Duc (#1223)

  • Fixed crash when using -[IGListCollectionContext dequeueReusableCellOfClass:withReuseIdentifier:forSectionController:atIndex:] Jeremy Lawrence (3b19cfb)

  • Added missing method override to IGListBindingSectionController that updates the internal viewModels array after moving a cell. Dennis Mรผller (#1262)

  • Fixed logic flaw in [IGListCollectionViewLayout shouldInvalidateLayoutForBoundsChange:]. Allen Hsu (#1236)

  • Fixed crash when calling [UICollectionView layoutAttributesForSupplementaryElementOfKind...] with IGListCollectionViewLayout and the section controller doesn't actually return a supplementary view Maxime Ollivier (cddb297)

  • Added IGListExperimentAvoidLayoutOnScrollToObject to avoid creating off-screen cells when calling [IGListAdapter scrollToObject ...]. Maxime Ollivier (6faddd9)

  • Added IGListExperimentFixIndexPathImbalance to test fixing a crash when inserting and deleting the same NSIndexPath multiple times. Maxime Ollivier (7824698)

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics