diff --git a/CHANGELOG.md b/CHANGELOG.md index 84b9d906..766c7071 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ The changelog for `IGListKit`. Also see the [releases](https://github.com/instag - Reordered position of intercepted selector in `IGListAdapterProxy`'s `isInterceptedSelector` method to reduce overall consumption of compare. [zhongwuzw](https://github.com/zhongwu) [(#1055)](https://github.com/Instagram/IGListKit/pull/1055) +- Made IGListTransitionDelegate inherited from NSObject. [Igor Vasilenko](https://github.com/vasilenkoigor) [(#1075)](https://github.com/Instagram/IGListKit/pull/1075) + ### Fixes - Duplicate objects for initial data source setup filtered out. [Mikhail Vashlyaev](https://github.com/yemodin) [(#993](https://github.com/Instagram/IGListKit/pull/993) diff --git a/Source/Internal/IGListAdapter+UICollectionView.m b/Source/Internal/IGListAdapter+UICollectionView.m index 2ff1d47a..5cfa3df0 100644 --- a/Source/Internal/IGListAdapter+UICollectionView.m +++ b/Source/Internal/IGListAdapter+UICollectionView.m @@ -218,10 +218,13 @@ customizedInitialLayoutAttributes:(UICollectionViewLayoutAttributes *)attributes atIndexPath:(NSIndexPath *)indexPath { IGListSectionController *sectionController = [self sectionControllerForSection:indexPath.section]; - return [sectionController.transitionDelegate listAdapter:self - customizedInitialLayoutAttributes:attributes - sectionController:sectionController - atIndex:indexPath.item]; + if (sectionController.transitionDelegate) { + return [sectionController.transitionDelegate listAdapter:self + customizedInitialLayoutAttributes:attributes + sectionController:sectionController + atIndex:indexPath.item]; + } + return attributes; } - (UICollectionViewLayoutAttributes *)collectionView:(UICollectionView *)collectionView @@ -229,10 +232,13 @@ customizedFinalLayoutAttributes:(UICollectionViewLayoutAttributes *)attributes atIndexPath:(NSIndexPath *)indexPath { IGListSectionController *sectionController = [self sectionControllerForSection:indexPath.section]; - return [sectionController.transitionDelegate listAdapter:self - customizedFinalLayoutAttributes:attributes - sectionController:sectionController - atIndex:indexPath.item]; + if (sectionController.transitionDelegate) { + return [sectionController.transitionDelegate listAdapter:self + customizedFinalLayoutAttributes:attributes + sectionController:sectionController + atIndex:indexPath.item]; + } + return attributes; } @end