Summary: Closes https://github.com/Instagram/IGListKit/pull/735 Differential Revision: D5048185 Pulled By: jessesquires fbshipit-source-id: 3f1a6826a4088043d883533f4f933a0a7ea42d60
21 KiB
CHANGELOG
The changelog for IGListKit. Also see the releases on GitHub.
3.1.0 (upcoming release)
3.0.0
This release closes the 3.0.0 milestone.
Breaking Changes
- Added Swift annotation names which remove
IGprefixes from class names, C functions, and other APIs. Note, this only affects Swift clients. Robert Payne (#593)
Example:
// OLD
class MySectionController : IGListSectionController { ... }
// NEW
class MySectionController : ListSectionController { ... }
// OLD
IGListDiff([], [], .equality)
// NEW
ListDiff(oldArray: [], newArray: [], .equality)
- Updated
didSelectdelegate call inIGListSingleSectionControllerDelegateto include object. Sherlouk (#397)
// OLD
- (void)didSelectSingleSectionController:(IGListSingleSectionController *)sectionController;
// NEW
- (void)didSelectSectionController:(IGListSingleSectionController *)sectionController
withObject:(id)object;
-
IGListUpdatingDelegatenow conforms toNSObject, bringing it in line with other framework protocols. Adlai Holler (#435) -
Changed
hasChangesmethods inIGListIndexPathResultandIGListIndexSetResultto read-only properties. Bofei Zhu (#453) -
Replaced
IGListGridCollectionViewLayoutwithIGListCollectionViewLayout. Ryan Nystrom (#482, #450) -
Renamed
IGListAdapterUpdaterDelegatemethod tolistAdapterUpdater:didPerformBatchUpdates:collectionView:. Vincent Peng (#491) -
Moved section controller mutations to
IGListBatchContext, provided as a parameter when calling-perfomBatchAnimated:updates:completionon a section controller'scollectionContext. All updates (insert, delete, reload item/section controller) must now be done inside a batch update block. Ryan Nystrom (a15ea08)
// OLD
[self.collectionContext performBatchAnimated:YES updates:^{
self.expanded = YES;
[self.collectionContext insertInSectionController:self atIndexes:[NSIndexSet indexSetWithIndex:1]];
} completion:nil];
// NEW
[self.collectionContext performBatchAnimated:YES updates:^(id<IGListBatchContext> batchContext) {
self.expanded = YES;
[batchContext insertInSectionController:self atIndexes:[NSIndexSet indexSetWithIndex:1]];
} completion:nil];
// OLD
[self.collectionContext reloadSectionController:self];
// NEW
[self.collectionContext performBatchAnimated:YES updates:^(id<IGListBatchContext> batchContext) {
[batchContext reloadSectionController:self];
} completion:nil];
-
-[IGListCollectionContext containerSize]no longer accounts for the content inset of the collection view when returning a size. If you require that behavior, you can now use-[IGListCollectionContext insetContainerSize]. Ryan Nystrom (623ff2a) -
IGListCollectionViewhas been completely removed in favor of using plain oldUICollectionView. See discussion at #409 for details. Jesse Squires (2284ce3) -
IGListBatchUpdateDatareplaced itsNSSetproperties withNSArrayinstead. Ryan Nystrom (#616) -
IGListUpdatingDelegatenow requires method-reloadItemInCollectionView:fromIndexPath:toIndexPath:to handle reloading cells between index paths. Ryan Nystrom (#657) -
-[IGListCollectionContext sectionForSectionController:]has been removed and replaced with theNSInteger sectionIndexproperty onIGListSectionController. Andrew Monshizadeh #671
Enhancements
-
Added an initializer on
IGListAdapterthat does not take aworkingRangeSizeand defaults it to 0. BasThomas (#686) -
Added
-[IGListAdapter visibleCellsForObject:]API. Sherlouk (#442) -
Added
-[IGListAdapter sectionControllerForSection:]API. Adlai-Holler (#477) -
You can now manually move items (cells) within a section controller, ex:
[self.collectionContext moveInSectionController:self fromIndex:0 toIndex:1]. Ryan Nystrom (#418) -
Invalidate the layout of a section controller and control the transition with
UIViewanimation APIs. Ryan Nystrom (#499) -
Added
-[IGListAdapter visibleIndexPathsForSectionController:]API. Malecks (#465) -
Added
IGListBindingSectionControllerwhich automatically binds view models to cells and animates updates at the cell level. Ryan Nystrom (#494) -
Added
IGListGenericSectionControllerto take advantage of Objective-C (and Swift) generics and automatically store strongly-typed references to the object powering your section controller. Ryan Nystrom (301f147) -
Added a debug option for IGListKit that you can print to lldb via
po [IGListDebugger dump]. Ryan Nystrom (#617)
Fixes
-
Gracefully handle a
nilsection controller returned by anIGListAdapterDataSource. Ryan Nystrom (#488) -
Fix bug where emptyView's hidden status is not updated after the number of items is changed with
insertInSectionController:atIndexes:or related methods. Peter Edmonston (#395) -
Fix bug where
IGListStackedSectionController's children need to knownumberOrItemsbefore didUpdate is called. (#348) -
Fix bug where
-[UICollectionViewCell ig_setStackedSectionControllerIndex:]should useOBJC_ASSOCIATION_COPY_NONATOMICfor NSNumber. PhilCai (#424) -
Fix potential bug with suppressing animations (by passing
NO) during-[IGListAdapter performUpdatesAnimated: completion:]where user would see UI glitches/flashing. Jesse Squires (019c990) -
Fix bug where scroll position would be incorrect in call to
-[IGListAdapter scrollToObject:supplementaryKinds:scrollDirection:scrollPosition:animated:with scrollDirection/scrollPosition of UICollectionViewScrollDirectionVertical/UICollectionViewScrollPositionCenteredVertically or UICollectionViewScrollDirectionHorizontal/UICollectionViewScrollPositionCenteredHorizontally and with a collection view with nonzero contentInset. David Yamnitsky (5cc0fcd) -
Fix a crash when reusing collection views between embedded
IGListAdapters. Ryan Nystrom (#517) -
Only collect batch updates when explicitly inside the batch update block, execute them otherwise. Fixes dropped updates. Ryan Nystrom (#494)
-
Remove objects that return
nildiff identifiers before updating. Ryan Nystrom (af984ca) -
Fix a potential crash when a section is moved and deleted at the same time. Ryan Nystrom (#577)
-
Prevent section controllers and supplementary sources from returning negative sizes that crash
UICollectionViewFlowLayout. Ryan Nystrom (#583) -
Add nullability annotations to a few more headers. Adlai Holler (#626)
-
Fix a crash when inserting or deleting from the same index within the same batch-update application. Ryan Nystrom (#616)
-
IGListSectionTypeprotocol was removed and its methods were absorted into theIGListSectionControllerbase class with default implementations. Ryan Nystrom (3102852) -
When setting the collection view on
IGListAdapter, its layout is now properly invalidated. Jesse Squires (#677) -
Fixes a bug when reusing
UICollectionViews with multipleIGListAdapters in an embedded environment that would accidentallynilthecollectionViewproperty of another adapter. Ryan Nystrom (#721) -
Fixes a bug where maintaining a reference to a section controller but not the list adapter in an async block could lead to calling
-[IGListAdapter sectionForSectionController:](or checking-[IGListSectionController sectionIndex]) and receiving an incorrect value. With the adapter check the value would be 0 because the adapter wasniland for the section controller property the value would be the last set index value. Andrew Monshizadeh (#709)
2.1.0
This release closes the 2.1.0 milestone.
Enhancements
-
Added support for macOS. Note: this is only for the Diffing components. There is no support for
IGListAdapter,IGListSectionController, and other components at this time. Guilherme Rambo (#235) -
Added a macOS example project. Guilherme Rambo (#337)
-
Disables
prefetchEnabledby default onIGListCollectionView. Sven Bacia (#323) -
Working ranges now work with
IGListStackedSectionController. Ryan Nystrom (#356) -
Added CocoaPods subspec for diffing,
IGListKit/Diffingand an installation guide. Sherlouk (#368) -
Added
allowsBackgroundReloadingflag (defaultYES) toIGListAdapterUpdaterso users can configure this behavior as needed. Adlai-Holler (#375) -
-[IGListAdapter updater]is now public (read-only). Adlai-Holler (#379)
Fixes
-
Avoid
UICollectionViewcrashes when queueing a reload and insert/delete on the same item as well as reloading an item in a section that is animating. Ryan Nystrom (#325) -
Prevent adapter data source from deallocating after queueing an update. Ryan Nystrom (4cc91a2)
-
Fix out-of-bounds bug when child section controllers in a stack remove cells. Ryan Nystrom (#358)
-
Fix a grid layout bug when item has full-width and iter-item spacing is not zero. Bofei Zhu (#361)
2.0.0
This release closes the 2.0.0 milestone. We've increased test coverage to 97%. Thanks to the 27 contributors who helped with this release!
You can find a migration guide here to assist with migrating between 1.0 and 2.0.
Breaking Changes
- Diff result method on
IGListIndexPathResultchanged.-resultWithUpdatedMovesAsDeleteInsertswas removed and replaced with-resultForBatchUpdates(b5aa5e3)
// OLD
- (IGListIndexPathResult *)resultWithUpdatedMovesAsDeleteInserts;
// NEW
- (IGListIndexPathResult *)resultForBatchUpdates;
-
IGListDiffableequality method changed fromisEqual:toisEqualToDiffableObject:(ab890fc) -
The default
NSObject<IGListDiffable>category was removed and replaced withNSString<IGListDiffable>andNSNumber<IGListDiffable>categories. All other models will need to conform toIGListDiffable. (3947600) -
Added support for specifying an end position when scrolling. Bofei Zhu (#196). The
IGListAdapterscrolling method changed:
// OLD
- (void)scrollToObject:(id)object
supplementaryKinds:(nullable NSArray<NSString *> *)supplementaryKinds
scrollDirection:(UICollectionViewScrollDirection)scrollDirection
animated:(BOOL)animated;
// NEW
- (void)scrollToObject:(id)object
supplementaryKinds:(nullable NSArray<NSString *> *)supplementaryKinds
scrollDirection:(UICollectionViewScrollDirection)scrollDirection
scrollPosition:(UICollectionViewScrollPosition)scrollPosition
animated:(BOOL)animated;
Fixes
-
Consider supplementary views with display and end-display events. Ryan Nystrom (#470)
-
Changed
NSUIntegertoNSIntegerin all public APIs. Suraya Shivji (#200)
Enhancements
-
Added support for supplementaryViews created from nibs. Rawlinxx (#90)
-
Added support for cells created from nibs. Sven Bacia (#56)
-
Added an additional initializer for
IGListSingleSectionControllerto be able to support single sections created from nibs. An example can be found here. (#56)
- (instancetype)initWithNibName:(NSString *)nibName
bundle:(nullable NSBundle *)bundle
configureBlock:(IGListSingleSectionCellConfigureBlock)configureBlock
sizeBlock:(IGListSingleSectionCellSizeBlock)sizeBlock;
-
Added
-isFirstSectionand-isLastSectionAPIs toIGListSectionController(316fbe2) -
Added support for cells and supplementaryViews created from storyboard. There's a new required method on the
IGListCollectionContextprotocol to do this. Bofei Zhu (#92)
// IGListCollectionContext
- (__kindof UICollectionViewCell *)dequeueReusableCellFromStoryboardWithIdentifier:(NSString *)identifier
forSectionController:(IGListSectionController<IGListSectionType> *)sectionController
atIndex:(NSInteger)index;
-
Added
tvOSsupport. Jesse Squires (#137) -
Added
-[IGListAdapter visibleObjects]API. Ryan Nystrom (386ae07) -
Added
-[IGListAdapter objectForSectionController:]API. Ayush Saraswat (#204) -
Added
IGListGridCollectionViewLayout, a section-based grid layout. Bofei Zhu (#225) -
Added support for scrolling to an index in a section controller from within that section controller. There's a new required method on the
IGListCollectionContextprotocol to do this. Jesse Squires (e5afb5b)
// IGListCollectionContext
- (void)scrollToSectionController:(IGListSectionController<IGListSectionType> *)sectionController
atIndex:(NSInteger)index
scrollPosition:(UICollectionViewScrollPosition)scrollPosition
animated:(BOOL)animated;
Fixes
-
Fixed
-[IGListAdapter reloadDataWithCompletion:]not returning early whencollectionViewordataSourceisnilandcompletionisnil. Ben Asher (#51) -
Prevent
UICollectionViewbug when accessing a cell during working range updates. Ryan Nystrom (#216) -
Skip reloading for objects that are not found when calling
-[IGListAdapter reloadObjects:]. Ryan Nystrom (ca15e29) -
Fixes a crash when a reload is queued for an object that is deleted in the same runloop turn. Ryan Nystrom (7c3d499)
-
Fixed a bug where
IGListStackSectionControllerwould only set its supplementary source once. Ryan Nystrom (#286) -
Fixed a bug where
IGListStackSectionControllerpassed the wrong section controller for will-drag scroll events. Ryan Nystrom (#286) -
Fixed a crash when deselecting a cell through a child section controller in an
IGListStackSectionController. Ryan Nystrom (#295)
Documentation
-
We now have 100% documentation coverage. Docs been refined and clarified. Jesse Squires (#207)
-
Added new Guides: Getting Started, Migration
-
Added examples for Today & iMessage extensions. Sherlouk (#112)
1.0.0
Initial release. 🎉