IGListKit v3.0.0 Release Notes

Release Date: 2017-05-12 // almost 7 years ago
  • ๐Ÿš€ This release closes the 3.0.0 milestone.

    ๐Ÿ’ฅ Breaking Changes

    • โž• Added Swift annotation names which remove IG prefixes 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 didSelect delegate call in IGListSingleSectionControllerDelegate to include object. Sherlouk (#397)
    // OLD
    - (void)didSelectSingleSectionController:(IGListSingleSectionController *)sectionController;
    
    // NEW
    - (void)didSelectSectionController:(IGListSingleSectionController *)sectionController
                            withObject:(id)object;
    
    • โšก๏ธ IGListUpdatingDelegate now conforms to NSObject, bringing it in line with other framework protocols. Adlai Holler (#435)

    • ๐Ÿ”„ Changed hasChanges methods in IGListIndexPathResult and IGListIndexSetResult to read-only properties. Bofei Zhu (#453)

    • Replaced IGListGridCollectionViewLayout with IGListCollectionViewLayout. Ryan Nystrom (#482, #450)

    • โšก๏ธ Renamed IGListAdapterUpdaterDelegate method to listAdapterUpdater:didPerformBatchUpdates:collectionView:. Vincent Peng (#491)

    • โšก๏ธ Moved section controller mutations to IGListBatchContext, provided as a parameter when calling -performBatchAnimated:updates:completion on a section controller's collectionContext. 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)

    • ๐Ÿšš IGListCollectionView has been completely removed in favor of using plain old UICollectionView. See discussion at #409 for details. Jesse Squires (2284ce3)

    • โšก๏ธ IGListBatchUpdateData replaced its NSSet properties with NSArray instead. Ryan Nystrom (#616)

    • โšก๏ธ IGListUpdatingDelegate now requires method -reloadItemInCollectionView:fromIndexPath:toIndexPath: to handle reloading cells between index paths. Ryan Nystrom (#657)

    • ๐Ÿšš -[IGListCollectionContext sectionForSectionController:] has been removed and replaced with the NSInteger sectionIndex property on IGListSectionController. Andrew Monshizadeh #671

    โœจ Enhancements

    • โž• Added an initializer on IGListAdapter that does not take a workingRangeSize and 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 UIView animation APIs. Ryan Nystrom (#499)

    • โž• Added -[IGListAdapter visibleIndexPathsForSectionController:] API. Malecks (#465)

    • โž• Added IGListBindingSectionController which automatically binds view models to cells and animates updates at the cell level. Ryan Nystrom (#494)

    • โž• Added IGListGenericSectionController to 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 nil section controller returned by an IGListAdapterDataSource. 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 know numberOrItems before didUpdate is called. (#348)

    • Fix bug where -[UICollectionViewCell ig_setStackedSectionControllerIndex:] should use OBJC_ASSOCIATION_COPY_NONATOMIC for 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 nil diff 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)

    • ๐Ÿšš IGListSectionType protocol was removed and its methods were absorted into the IGListSectionController base 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 multiple IGListAdapters in an embedded environment that would accidentally nil the collectionView property 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 was nil and for the section controller property the value would be the last set index value. Andrew Monshizadeh (#709)