From 145327647b69ae3ab2dd2a84a9bbbcf78d5f41a4 Mon Sep 17 00:00:00 2001 From: Jesse Squires Date: Wed, 19 Apr 2017 12:58:58 -0700 Subject: [PATCH] Invalidate layout when collection view reused between IGListAdapters Summary: Closes #659 Closes https://github.com/Instagram/IGListKit/pull/677 Differential Revision: D4915322 Pulled By: jessesquires fbshipit-source-id: 2ae6ff4ee1726fe2395233d7d662c0b12956a746 --- CHANGELOG.md | 2 ++ Source/IGListAdapter.m | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6178113b..1fb2bfb4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -104,6 +104,8 @@ This release closes the [3.0.0 milestone](https://github.com/Instagram/IGListKit - `IGListSectionType` protocol was removed and its methods were absorted into the `IGListSectionController` base class with default implementations. [Ryan Nystrom](https://github.com/rnystrom) (tbd) +- When setting the collection view on `IGListAdapter`, its layout is now properly invalidated. [Jesse Squires](https://github.com/jessesquires) [(#677)](https://github.com/Instagram/IGListKit/pull/677) + 2.1.0 ----- diff --git a/Source/IGListAdapter.m b/Source/IGListAdapter.m index 4fff8edbb..21b8cccf2 100644 --- a/Source/IGListAdapter.m +++ b/Source/IGListAdapter.m @@ -83,6 +83,7 @@ - (void)setCollectionView:(UICollectionView *)collectionView { _collectionView = collectionView; _collectionView.dataSource = self; + [_collectionView.collectionViewLayout invalidateLayout]; [self updateCollectionViewDelegate]; [self updateAfterPublicSettingsChange];