Commit graph

6 commits

Author SHA1 Message Date
Nate Stedman
1a44045dce Run lint on IGListKit
Differential Revision: D19141253

fbshipit-source-id: 9ed4c278a91bb48a1f6d33cafa9ce8f21861573d
2019-12-19 09:34:42 -08:00
Zhisheng Huang
d7a6fc0847 Add a flag to control how the IGSectionObject's isEqualToDiffable: is implemented
Summary:
In the Feed view, all the -isEqualToDiffable: implementation only checks the pk, a.k.a the identifier.

Let's mimic that behavior.

Reviewed By: calimarkus

Differential Revision: D18714064

fbshipit-source-id: e1fe9624da2997ecc7ca9b684ddd471d77b7564c
2019-12-04 15:32:04 -08:00
Nate Stedman
e4c60650f2 Split IGListKit and IGListDiffKit (#1377)
Summary:
Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1377

This splits the diffing-only components from `IGListKit` out into a separate library, `IGListDiffKit`, allowing them to be used independently of the rest of `IGListKit`. We've found that the diffing components of the library are useful independently of the rest of the `UICollectionView` infrastructure, and separating the libraries allows apps to take advantage of those components without paying the full binary size cost of `IGListKit`. The diffing components are available as a subspec in Cocoapods, and as an independent framework in Carthage and direct Xcode project import (i.e. Git submodules).

This is a breaking change, necessitating a major version bump, although it should have only minor impact for projects using the umbrella header `IGListKit.h`, as that header continues to import the diffing utilities. In particular, for a project using Cocoapods and importing `IGListKit.h`, there should be no code changes required.

Reviewed By: calimarkus

Differential Revision: D18114249

fbshipit-source-id: 363b5a427e32800bbc6e82f897230963b4167245
2019-10-31 08:26:12 -07:00
Ryan Nystrom
8d8a632b67 Update MIT license language (#1272)
Summary:
Updating license language to meet FB open source standards.
Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1272

Differential Revision: D12844366

Pulled By: rnystrom

fbshipit-source-id: 27ae49ae00d963c5c012c79c5738365c232a5773
2018-11-01 10:58:46 -07:00
Zhisheng Huang
f699ea0e17 Add option to update cells instead of delete+insert for section reload
Summary:
We have seen unnecessary flashiness updates for any section reload updates.

Basically we have 1 section for 1 cell, which is recommended by the IGListKit document in https://instagram.github.io/IGListKit/best-practices-and-faq.html, specifically:

> "We highly recommend using single-item sections when possible."

However, the issue is that whenever we update the underlying data model, we would trigger a delete+insert for the section reload.

In order to mitigate that, we can fix this delete+insert changes or we use the `IGListBindingSectionController`, however, the latter one requires more refactoring plus view model wrapper to have `isEqualToDifferable:` to return YES, which seems less than ideal.

I am proposing that we add an option to the `IGListAdapterUpdater`, as `preferItemReloadsForSectionReloads` so that when it's set to YES, we would trigger the proper `-[UICollectionView reloadItemsAtIndexPaths:]` which handles the cell update properly.

This option also handles the case where the number of items in the section is changed before and after the updates, in that case, it will fallback to do the "delete+insert" section operation.

Reviewed By: rnystrom

Differential Revision: D9519519

fbshipit-source-id: 22ecca07679ebdd212cf771c61e40887cb6a9ba8
2018-08-28 23:32:43 -07:00
FBShipIt
cdc796746a Initial commit
fbshipit-source-id: c38b897b9e2b87c782e0e01b0145d9189dc7f9d8
2016-10-11 10:12:17 -04:00