Summary:
This pull request removes the `sectionForSectionController:` method from the `IGListCollectionContext` protocol so that the protocol is exclusively for presentation methods.
This should not add new functionality, but rather makes the index directly accessible on the section controllers themselves. This change makes sense because at no time will there be an update to the list that the list adapter is unaware of and so it will always be able to set and update any indexes for a section controller that has changed.
Issue fixed: #609
- [X] All tests pass. Demo project builds and runs.
- [X] I added tests, an experiment, or detailed why my change isn't tested.
- [X] 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/671
Reviewed By: jessesquires
Differential Revision: D4942159
Pulled By: amonshiz
fbshipit-source-id: d648cfdd381cbf1d9ee7ff549ae27d2972a84622
Summary:
The content inset of a collection view can change at any time (as it does with our refresh control) and isn't a good measure of the container size. I don't want to totally remove that API though, so I changed the default behavior, added an insets API, and also added the functionality of the original in a new API.
This makes sizes much more deterministic.
Reviewed By: jessesquires
Differential Revision: D4800758
fbshipit-source-id: 85ce843b5b1c297cea2e2ea705fa255617cbe356
Summary:
We constantly have random bugs pop up when mutations are made outside of a batch update. This change restricts the mutation API to a batch context object (which is just an `IGListAdapter`) so they can only be done **inside an update block**.
- Fixed open source project
- Confirmed open source examples build
- Updated all of Instagram.app to use this API
- Changelog breaking changes entry
Fixes#392
Reviewed By: jessesquires
Differential Revision: D4754129
fbshipit-source-id: 11d32a0fac3e50c9edbb01e92a8a0c7b8a43cf2d
Summary:
Add API for #315. Not sure if this is what you want rnystrom though 🤔. Will add tests after you confirm.
- [x] All tests pass. Demo project builds and runs.
- [x] 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/456
Reviewed By: jessesquires
Differential Revision: D4697190
Pulled By: rnystrom
fbshipit-source-id: f8513cf2fa33441eb40f486954136553d19dda0c
Summary:
Add IGListCollectionContext API to get visible indexes:
`- (NSArray<NSIndexPath *> *)visiblePathsForSectionController:(IGListSectionController<IGListSectionType> *) sectionController`
Issue fixed: #465
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] 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/507
Differential Revision: D4621418
Pulled By: jessesquires
fbshipit-source-id: 4b55500c83ca1b911c418e5857756bb076fc80e4
Summary:
Adding a new layout-invalidation API, telling the layout object to query and rebuild the layout for all items in the section controller. This works with `UICollectionViewFlowLayout` and should work with other custom layouts (including our own).
Issue fixed: #360, #459
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
Closes https://github.com/Instagram/IGListKit/pull/499
Reviewed By: jessesquires
Differential Revision: D4590274
Pulled By: rnystrom
fbshipit-source-id: f87235be4e6c024bf979b831a8938be68895e011
Summary:
Adding an API to do item-level (cell) moves on the collection view. This complicates things a little bit because of all the issues that moving sections have while in batch updates (e.g. simultaneous animation UICV bugs). Thankfully we use pretty strict types so the compiler does most of the work for us.
Closes#145
- [x] Tests build and pass
- [x] Add `IGListBatchUpdateData` tests to check moves during
- [x] ~~Moving within a reloaded section (no op)~~ can't reload sections
- [x] Moving within a deleted section (no op)
- [x] Moving within a moved section (convert section ops to delete+insert)
- [x] Moving an index path that is also reloaded (convert to delete+insert path)
- [x] Add move unit tests to `IGListAdapterUpdater`
- [x] Add move unit tests to `IGListReloadDataUpdater` (mostly for code coverage...)
- [x] Add move unit tests to `IGListStackedSectionController`
- [x] Add `CHANGELOG.md` entry for 3.0.0
- [x] Test moving without batch
Closes https://github.com/Instagram/IGListKit/pull/418
Reviewed By: jessesquires
Differential Revision: D4521732
Pulled By: rnystrom
fbshipit-source-id: 99a46d1cbb0cc1f857a62ff6ca257aff6e8b7f25
Summary:
- [x] All tests pass. Demo project builds and runs.
No breaking changes that I am aware of.
Closes https://github.com/Instagram/IGListKit/pull/440
Differential Revision: D4448496
Pulled By: rnystrom
fbshipit-source-id: 9ad9bc3734b605ceab25bf6cdf993568aa6561c1
Summary:
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] 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/426
Differential Revision: D4428853
Pulled By: rnystrom
fbshipit-source-id: 1c5f3aa196a726986be291c7347eded853eb0eac
Summary:
The reloadData method in IGListStackedSectionController was being called too soon. It was moved from the constructor to the `didUpdateToObject` method. Tests were updated to reflect the change.
- [x] All tests pass. Demo project builds and runs.
- [x] 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/390
Differential Revision: D4419751
Pulled By: rnystrom
fbshipit-source-id: 7c812d306b23dd251c160425873930eb8022b1a5
Summary:
Fixes bug reported internally. When items are removed dynamically the stack internal store will attempt to access data that has already been removed. Instead use assoc objects.
We did change `IGListAdapter` to [use a map](https://github.com/Instagram/IGListKit/blob/master/Source/IGListAdapter.m#L681) instead of assoc objects. That could be a good cleanup.
cc cdoncarroll
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/358
Differential Revision: D4363840
Pulled By: jessesquires
fbshipit-source-id: ef73b4302f88a15cbf70378421d702f7e2bddbd5
Summary:
Beefing up our test coverage. Made an improvement to supplementary view behavior along the way. Will update `CHANGELOG.md` once travis finishes w/ link to PR #.
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/286
Differential Revision: D4281961
Pulled By: jessesquires
fbshipit-source-id: 32b5877bd72250b9a99e600ceffc64d686fa5651
Summary:
Fixes from PR #273 rebase.
jessesquires rnystrom this should look a little better and be able to merge.
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/275
Differential Revision: D4271440
Pulled By: rnystrom
fbshipit-source-id: a85b8c80b5504640d7f82b183ed5b5d0d0ea5c1b
Summary:
- Add scrolling method on IGListCollectionContext so that section controllers can scroll to themselves.
- Update CHANGELOG.
- Other misc fixes.
- Closes#267 on GitHub.
Reviewed By: rnystrom
Differential Revision: D4261144
fbshipit-source-id: 9eed833cfff06107607bba01a0beee1d871497b6
Summary:
Swapped NSUInteger to NSInteger in public headers. Fixed a test in IGListSectionMapTests.m to pass with NSInteger. For issue #200!
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/205
Differential Revision: D4191521
Pulled By: rnystrom
fbshipit-source-id: 3f15c5ee3f8ed2d382de2602912a2e998bfbcbba
Summary:
Continuing the work on #90. I don't believe I can push directly to that PR since the origin is `master` of a repo I don't have access to.
https://help.github.com/articles/checking-out-pull-requests-locally/
I went ahead and added another supplementary view test copying the old one we had.
cc jessesquires in case there's something else I can do here. I believe this will still give rawlinxx credit?
Closes https://github.com/Instagram/IGListKit/pull/162
Differential Revision: D4137364
Pulled By: rnystrom
fbshipit-source-id: d8418ac5728fd6d9570fa1d1568f4343f5c4112b
Summary:
Miss this in the previous PR #92. Will add unit test soon.
Closes https://github.com/Instagram/IGListKit/pull/123
Differential Revision: D4101594
Pulled By: rnystrom
fbshipit-source-id: 820030358532b0878f6d9e9092834266c9260a38
Summary:
I started working on adding support for dequeuing cells created from nibs (issue #1). Additionally I extended `IGListSingleSectionController` so that it can be used with nibs too. I don't know if you had this also in mind.
- [x] I'm currently thinking about the best way to test these changes.
- [x] I was not able to update the documentation (issue #55).
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/56
Reviewed By: dshahidehpour
Differential Revision: D4023746
Pulled By: rnystrom
fbshipit-source-id: 6a8b4cfb4dba38ea6e9870a9a4506288ee155cfe