From 3c41fb15e508783142e215b2ad8f2f3b1a6b0ff1 Mon Sep 17 00:00:00 2001 From: heshamsalman Date: Wed, 12 Apr 2017 16:11:51 -0700 Subject: [PATCH] Uniqueness assert of section controllers, close #567 Summary: Issue fixed: #567 - [ ] All tests pass. Demo project builds and runs. - [ ] I added tests, an experiment, or detailed why my change isn't tested. - [ ] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes. - [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md) Closes https://github.com/Instagram/IGListKit/pull/639 Differential Revision: D4878842 Pulled By: jessesquires fbshipit-source-id: 664648cf4f5e28d0a6af308e30151cb66863962c --- Source/IGListAdapter.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/IGListAdapter.m b/Source/IGListAdapter.m index 56905c52..84f0a545 100644 --- a/Source/IGListAdapter.m +++ b/Source/IGListAdapter.m @@ -529,6 +529,11 @@ } [sectionControllers addObject:sectionController]; + +#if DEBUG + IGAssert([NSSet setWithArray:sectionControllers].count == sectionControllers.count, + @"Section controllers array is not filled with unique objects; section controllers are being reused"); +#endif [validObjects addObject:object]; }