Commit graph

458 commits

Author SHA1 Message Date
Ryan Nystrom
d3e49fd789 Move map builder to static C function
Summary: This is much simpler as a static function instead of a block. Also taking an object vs plucking from the array will lend itself to better performance and reusability later.

Reviewed By: manicakes

Differential Revision: D6968684

fbshipit-source-id: 6166473feb20937ce6a1337b4b99a5a240778f56
2018-02-13 10:13:41 -08:00
Jared Verdi
f15b167e85 Interactive Reordering
Summary:
I had a desire for interactive reordering in a personal project, so here's a first attempt at adding support in IGListKit.

I figured I might as well get a WIP PR up for comments before I continue further as there are a few aspects to interactive reordering that don't interplay perfectly with IGListKit.

As discussed in #291, I went after two prime use cases:
1. Moving items amongst a section
2. Rearranging whole sections

I also "disabled" moving items between sections by having those moves revert, to mimic interactive reordering cancellation as closely as possible.

You can see both in the Mixed Data example. Grid items can be moved within a section, while users can be moved to reorder whole sections. But trying to move a grid item out of a grid or a user item into a grid will auto-revert. The revert animation isn't as tight as it should be. It may be more desirable to disable the animation - though you lose the visual cue.

There is a also a new example, `ReorderableViewController`, that demonstrates 2 in its pure form (likely the most desired use case), where all sections are reorderable single rows.

Happy to take feedback -- this is my first experience working on IGListKit, so I would expect there to be gaps. (Ex. I haven't used `IGListStackedSectionController`, and its tests failed as I hadn't implemented reordering delegates for it. Those are simply stubbed out for now.)

Issue fixed: #291

- [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)

- [x] Proper support in `IGListStackedSectionController`
Closes https://github.com/Instagram/IGListKit/pull/976

Differential Revision: D6674493

Pulled By: rnystrom

fbshipit-source-id: cd53c5fdc6fb59636edc4747c4bbd0f81a4610e5
2018-02-12 09:27:08 -08:00
Markus Emrich
e02dd0e7ed Add IGListDiffable remodel plugin source + documentation (a new guide)
Summary:
Adds the source for a remodel plugin to autogenerate models conforming to `IGListDIffable`.

- [x] All tests pass. Demo project builds and runs. (source untouched, purely additive)
- [x] I added remodel plugin tests + and a new guide explaining the installation + usage
- [ ] 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/1083

Reviewed By: rnystrom

Differential Revision: D6937925

Pulled By: calimarkus

fbshipit-source-id: 54228cddf387cf20ceceec1732e439ab6fd4b984
2018-02-09 10:18:18 -08:00
Ryan Nystrom
7414685358 Prep changelog for 3.3.0
Summary: Closes https://github.com/Instagram/IGListKit/pull/1091

Differential Revision: D6927178

Pulled By: rnystrom

fbshipit-source-id: 7007f7dcc1ca9cb042d25c829588f27f3d94b49d
2018-02-07 12:33:22 -08:00
Ryan Nystrom
663b606c58 Readme reflects min macOS requirement of 10.11
Summary: Closes https://github.com/Instagram/IGListKit/pull/1089

Differential Revision: D6918813

Pulled By: rnystrom

fbshipit-source-id: 13586a4ce3515538f6ef8f8ccebd58900d1fc306
2018-02-06 16:45:21 -08:00
Ryan Nystrom
f536e2136d Generate 3.2 docs
Summary:
Does this need to wait for #1086?
Closes https://github.com/Instagram/IGListKit/pull/1085

Differential Revision: D6917735

Pulled By: rnystrom

fbshipit-source-id: 08165c8d9f1215abac1d4bc7c65c1d23e31f758a
2018-02-06 15:47:20 -08:00
Ryan Nystrom
33807fb1c6 Remove change for feature that isnt shipping
Summary:
Will be removing this experiment, don't include it in the 3.2 release notes.
Closes https://github.com/Instagram/IGListKit/pull/1086

Differential Revision: D6917740

Pulled By: rnystrom

fbshipit-source-id: 5ce4eb8a5bfc5f1450462123a1aa4689f8f00e41
2018-02-06 15:47:20 -08:00
Ryan Nystrom
96445ef2a0 Update podspec, project, and examples to 3.2
Summary: Closes https://github.com/Instagram/IGListKit/pull/1087

Differential Revision: D6917772

Pulled By: rnystrom

fbshipit-source-id: a1e965c58d6da6ef5b32a3bc3c2f23f37fc64794
2018-02-06 15:47:20 -08:00
Zhisheng Huang
c617b18eb6 Move the DEBUG uniqueness check outside of for-loop inside IGListAdapter
Summary:
The original DEBUG was put inside a for loop, which caused a quadratic looping while creating bigger and bigger NSSet.

This is very inefficient and I verified that by profiling with 10000 objects in the array and it caused significant amount of CPU. The main thread is pretty much unresponsive.
Closes https://github.com/Instagram/IGListKit/pull/1084

Reviewed By: rnystrom

Differential Revision: D6903043

Pulled By: lorixx

fbshipit-source-id: 311e8a402eb8d5574fce0eabd626a674b6a5e8c5
2018-02-05 12:38:27 -08:00
Ryan Nystrom
37c798ac78 Bump min macOS version to 10.11 #trivial
Summary:
Followup from #1068

The `NSIndexPath` methods we use **are not** available <10.11. In theory this has always been "broken" b/c older macOS versions would crash at runtime when trying to use these methods.

Normally this would be breaking change, but I can't imagine anyone is using IGListKit on the mac targeting 10.10 and shipping a working app.

cc jessesquires for thoughts

This should be the last remaining item before we get a green badge.

(note that 10.11 was released 9/30/15 which is about 2 weeks before the public IGListKit release)
Closes https://github.com/Instagram/IGListKit/pull/1080

Differential Revision: D6894369

Pulled By: rnystrom

fbshipit-source-id: e5992c7bba68b21704af6bc8fb889b5427266954
2018-02-03 08:31:28 -08:00
Jesse Squires
95b779a584 Update .travis.yml and lint.sh, try to fix #1060 and lint errors #trivial
Summary:
project:
- fix file target membership issues in framework targets and test targets
- fix private/internal header imports, which shouldn't be `<IGListKit/` apparently
- fix static analyzer errors

travis:
- always install latest swiftlint
- ~~don't cache bundler, attempts to fix #1060~~
- remove markdown link check

swiftlint:
- make script non-failing if *any* version of swiftlint is installed
- warning if incorrect version is installed
- fail if not installed
- remove `scripts/generate_ci_yaml.rb`, we can just set the config file path directly
Closes https://github.com/Instagram/IGListKit/pull/1068

Differential Revision: D6885575

Pulled By: rnystrom

fbshipit-source-id: 51b7baa73feefcea71d870c1220d0382df484199
2018-02-02 13:16:46 -08:00
Michelle Deng
29a82d744d Revert D6871289: [IGListKit][PR] Removed unnecessary nil check on transitionDelegate
Summary:
This reverts commit 7ccf5a286ab4ee63bf72273142857496ce62b6f4

bypass-lint

An infra SEV is better than not reverting this diff.
If you copy this password, see you in SEV Review!
cause_a_sev_many_files

Differential Revision:
D6871289

Original commit changeset: 7ccf5a286ab4

fbshipit-source-id: e75cc7bd4a378e1092f4a01be3104fddb336759a
2018-02-02 07:35:07 -08:00
Ryan Nystrom
1d87526bab Fixup project file corruption
Summary:
Continuing issues raised in #1068. Project file was totally busted for macOS and AppleTV.
Closes https://github.com/Instagram/IGListKit/pull/1079

Differential Revision: D6883599

Pulled By: rnystrom

fbshipit-source-id: 29b118c87ffd302b3e54a47f81305292bd38a8fe
2018-02-02 07:02:04 -08:00
Igor Vasilenko
316779fb74 Removed unnecessary nil check on transitionDelegate
Summary:
Issue fixed: #1071

- [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/1076

Differential Revision: D6871289

Pulled By: rnystrom

fbshipit-source-id: 7ccf5a286ab4ee63bf72273142857496ce62b6f4
2018-02-01 07:04:42 -08:00
Ryan Nystrom
64676d5907 Add collection view as an exception param and capture data source state on crash
Summary:
Adding more metadata about the state of the data source at the time of crash.

Note that this will be a breaking change to the public repo, but it's on a much-less used API, and since this is very high-pri for us at the moment, I'm willing to make the breakage.

Reviewed By: manicakes

Differential Revision: D6863683

fbshipit-source-id: e979aea445abc1ea556182cb69758703499e161a
2018-01-31 15:16:59 -08:00
Vasilenko Igor Vladimirovich
f55b6d2895 Made IGListTransitionDelegate inherited from NSObject
Summary:
Issue fixed: #1072

Changes don't need new tests.

- [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/1075

Differential Revision: D6858886

Pulled By: rnystrom

fbshipit-source-id: ec3816cc66aa2f10c21ccc7dea6078adc034e74e
2018-01-31 11:17:59 -08:00
Ryan Nystrom
877ae3efdf Pod install at root to fix tests #trivial
Summary:
From #1068
Closes https://github.com/Instagram/IGListKit/pull/1074

Differential Revision: D6848813

Pulled By: rnystrom

fbshipit-source-id: 0d1f3522948fee0c19183d1417d343052e7b88d5
2018-01-30 13:02:49 -08:00
zhongwuzw
8bccac9a79 Optimize SEL search efficiency
Summary:
Optimize `SEL` search efficiency, reduced the time complexity from O (n) to O (1).

Not need tests.

- [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/1055

Differential Revision: D6839942

Pulled By: rnystrom

fbshipit-source-id: 911755d6f8a4cd79b387423a51b6ea44cc7a2a07
2018-01-29 20:32:57 -08:00
Ryan Nystrom
783adf8014 Fix project, examples, and CHANGELOG from internal changes
Summary:
- Unbreak builds so PRs should work (requires rebase)
- Add CHANGELOG entry
Closes https://github.com/Instagram/IGListKit/pull/1069

Differential Revision: D6839909

Pulled By: rnystrom

fbshipit-source-id: abe0c75b50069ec9aac55b6acb7872fd2c8f04fb
2018-01-29 16:03:58 -08:00
Sue Suhan Ma
a18bd7c495 Customized animation unit test
Summary: test when the item is inserted/removed, if the layout could successfully get the initial/final attributes from the section controller

Reviewed By: rnystrom

Differential Revision: D6759201

fbshipit-source-id: e674662d1e47c374d38019c988c1a37fece2417a
2018-01-29 12:34:13 -08:00
Sue Suhan Ma
26924ec3b6 Customized post insertion animation
Summary:
The current animation is the collection default animation - fade in/out: demo: https://pxl.cl/bj8R
Based on our design, we want the Shelf to be push down: demo https://pxl.cl/bj9R

1. Created **IGListCollectionViewDelegate** which inherits **UICollectionViewDelegateFlowLayout**
2. **IGListAdapter ** conforms **UICollectionViewDelegateFlowLayout**
3. add **transitionDelegate** to IGListSectionController
4. **IGFeedSectionController** sets transitionDelegate as itself and handles IGListCollectionViewDelegate methods

Reviewed By: rnystrom

Differential Revision: D6785726

fbshipit-source-id: bdf19f84fef05264ca0e082c6a326a31494a20da
2018-01-29 11:03:11 -08:00
Ryan Nystrom
b0283bfcdb Add 1024 size icon to examples project #trivial
Summary:
Issue fixed: #1056
Closes https://github.com/Instagram/IGListKit/pull/1066

Differential Revision: D6835607

Pulled By: rnystrom

fbshipit-source-id: edfeb59bd2202140845f0aa676238f9a970dc3e3
2018-01-29 11:03:11 -08:00
Mukesh Thawani
3d9904950a Run pod_setup.sh when Source files are added or removed
Summary:
Issue fixed: #1022

- [ ] 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/1031

Reviewed By: jeremycohen

Differential Revision: D6657283

Pulled By: rnystrom

fbshipit-source-id: 3033e08dbe1a0fd5b52f254dbefc924693b84b51
2018-01-22 14:53:00 -08:00
Jesse Squires
b79130ca35 Fix deadlink detection close #1059
Summary:
The directory is `.vendor/` **not** `vendor/` 😳
Closes https://github.com/Instagram/IGListKit/pull/1061

Differential Revision: D6778511

Pulled By: rnystrom

fbshipit-source-id: 1384600b91f8071daaeb1ad71c24b7e9a730f9eb
2018-01-22 14:53:00 -08:00
Jesse Squires
8dd464e712 Update swiftlint + script, add newrules, autocorrect
Summary:
- Updates to SwiftLint 0.24.2
- Improve `scripts/lint.sh`
    - pull version out to a var for easier maintenance
    - better error message
    - make script fail xcode build if not installed (so we don't commit lint errors)
- Adds a few new SwiftLint rules
- Correct all new lint errors (most can be done by running `swiftlint autocorrect`)
- Cleans up `.swiftlint.yml`
- Fix up example projects
Closes https://github.com/Instagram/IGListKit/pull/1058

Differential Revision: D6776177

Pulled By: rnystrom

fbshipit-source-id: 345172237b97aaed0d62312c8f366f46145f8cd9
2018-01-22 12:14:38 -08:00
Ryan Nystrom
e3aa05a2ee Update Travis to Xcode 9.2 #trivial
Summary:
Issue fixed: #1009
Closes https://github.com/Instagram/IGListKit/pull/1025

Differential Revision: D6771239

Pulled By: rnystrom

fbshipit-source-id: be722bcded6fd5d04e0988d39a4ff58a7cef749e
2018-01-21 18:51:27 -08:00
Maxime Ollivier
17c4d02119 fix IGListKit updates logging
Summary:
* Issue: we don't log the IGListKit updates
* Cause: IGListAdapterUpdater clears the ongoing updates before we call the delegate (https://fburl.com/76w5wvpl)
* Fix: keep a hold of the updates before calling executeCompletionBlocks(...)

Reviewed By: rnystrom

Differential Revision: D6750327

fbshipit-source-id: a30572873ab753b067977288cdb465a2a222e715
2018-01-18 13:17:31 -08:00
Maxime Ollivier
a8275e08e1 clarify assert message
Summary:
* Clarify assert message by adding item width/height
 * Before: Width of item 1 in section 2 must be less than container 375 accounting for section insets {0, 0, 0, 0}
 * After: Width of item 1 in section 2 (415 pt) must be less than or equal to container (375 pt) accounting for section insets {0, 0, 0, 0}

Reviewed By: rnystrom

Differential Revision: D6711829

fbshipit-source-id: be99e83fd68cd345cb6a05acdde27c8252e59650
2018-01-16 07:59:35 -08:00
Jesse Squires
82b52b2050 Make SwiftLint comment inline
Summary: Closes https://github.com/Instagram/IGListKit/pull/1039

Differential Revision: D6657289

Pulled By: rnystrom

fbshipit-source-id: 806f9624fab2dabe811e5f13a5b45d17db6ddca2
2018-01-03 12:47:33 -08:00
Ryan Nystrom
8ae6013d0e Test fixing double insert crash
Summary: Looking at crash logs, the new high-firing crash has 2 item inserts in it. Test deduping the insert. Testing b/c I want to make sure there aren't any weird side effects.

Differential Revision: D6605474

fbshipit-source-id: 522120074aed2ed4995104443d48d8254ddb4fec
2017-12-20 06:31:42 -08:00
Jesse Squires
ae7f36f5c2 Update gems, fix warnings, pod install
Summary:
- Update CocoaPods + Gems
- Update SwiftLint version
- Fix lint errors
- Fix `pod_setup.sh` script, move to `scripts/` (should now be run from root dir)
- Run `pod_setup.sh`
Closes https://github.com/Instagram/IGListKit/pull/1038

Differential Revision: D6602297

Pulled By: rnystrom

fbshipit-source-id: 1bf69611e041903cf982fe7d9a95197729e44d94
2017-12-19 09:31:37 -08:00
Darren Clark
6e4979f6c4 IGListSingleSectionControllerDelegate: add deselect delegate method
Summary:
Added `-didDeselectSectionController:withObject:` to `IGListSingleSectionControllerDelegate`.

Not sure if it makes sense to make it non-optional in 4.0.0 or not (#909) - I can add the [same note](0f04a07319/Source/IGListBindingSectionControllerSelectionDelegate.h (L40)) to the docs if it is

- [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/954

Differential Revision: D6164711

Pulled By: rnystrom

fbshipit-source-id: aa8cfd2bb72a16cb525d875e2cad93888f13c641
2017-12-18 12:45:09 -08:00
Yury Bogdanov
bc4132dba7 Negative size assertion
Summary:
Assertions for item's size added to prevent negative values return from IGListAdapter

Issue fixed: #977

- [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/992

Reviewed By: ryanolsonk

Differential Revision: D6272307

Pulled By: rnystrom

fbshipit-source-id: 844affd914329e0ca04597ada2952f1a077897af
2017-12-18 11:47:45 -08:00
yiplee
e63a0e78fe Add new iOS 11 api adjustedContentInset support
Summary:
adopt adjustedContentInset instead of contentInset on iOS 11

- [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/1020

Reviewed By: manicakes

Differential Revision: D6513703

Pulled By: rnystrom

fbshipit-source-id: 5d718f2cb30361959ca5ba8238746427223cb5fd
2017-12-18 08:51:14 -08:00
Maxime Ollivier
74c5fb3566 Update pods and examples
Summary:
Update pod and examples so project builds when synced

Depends on D6545334

Reviewed By: rnystrom

Differential Revision: D6573821

fbshipit-source-id: b0d4246fa9c0d627ebcd34ac7abd5c8453964037
2017-12-15 09:33:39 -08:00
Maxime Ollivier
23bcc5c7c0 created IGListCollectionView
Summary: * IGListCollectionView passes update information to IGListCollectionViewLayout.

Reviewed By: rnystrom

Differential Revision: D6510139

fbshipit-source-id: ada194d009eca7f308887ec592ecc41fb9557855
2017-12-15 09:33:39 -08:00
Maxime Ollivier
f0b947cd1f expose didModifySection on IGListCollectionViewLayout
Summary: * IGListCollectionViewLayout can now keep track of the minimumInvalidatedSection given individual section updates.

Reviewed By: rnystrom

Differential Revision: D6545333

fbshipit-source-id: 64c9b5ff32339299b52059a4d990a42d9e6a1af5
2017-12-15 09:33:39 -08:00
Maxime Ollivier
7a23ed521d update IGListCollectionViewLayout to allow for partial layout invalidation
Summary:
* Currently, we invalidate the entire layout whenever we make any updates, like inserting new rows at the bottom.
* This is one of the most common causes of frame drop on feed, so let's allow partial invalidation based on the minimum modified section.
  * For example, if we delete section 10, move section 4, and insert section 12, we would re-calculate the layout starting at section 4.
* This gets us the majority of the performance gains and it's relatively simple. In the future, we can make further optimizations, like 1) index path level invalidation and 2) finding the smallest modified index path whose properties (ex: size) have actually changed.

Reviewed By: rnystrom

Differential Revision: D6510140

fbshipit-source-id: 6ff1766b400c5aa82abc29ae76ab96660c3bb106
2017-12-15 09:33:39 -08:00
Ryan Nystrom
296baf5f85 Assert duplicate objects and check object types on map lookup
Summary:
Followup to make sure that object type mismatches can't happen, even if identifiers collide (which is discouraged). Add assert when duplicates are detected.

Patched some unit tests while I'm in here.

Reviewed By: calimarkus

Differential Revision: D6439094

fbshipit-source-id: d669c01734e5ce9483e851051f548d9960b3087c
2017-11-30 12:48:07 -08:00
Markus Emrich
85b1a42ec6 Add additional logging of fromClass for convertReloadToDeleteInsert assertion
Summary:
It's hard to figure out what the problem is, if you don't know which viewModel causes the trouble at all.
Let's add the class name to the assertion message.

Differential Revision: D6419460

fbshipit-source-id: 58edebca7839871b6d48e463caad957d7920e129
2017-11-27 16:01:31 -08:00
Ryan Nystrom
2d5eed2477 Add docs warning about reloadData being expensive
Summary: Followup from performance findings.

Reviewed By: maxoll

Differential Revision: D6388330

fbshipit-source-id: 057d5f49b5b8fd7216b795fef3977beba9368b3a
2017-11-21 13:18:17 -08:00
yemodin
c7d4dc29a8 Make sure collection have unique ListDiffable objects on initial data…
Summary:
… source setup too

Issue fixed: #815

- [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/993

Reviewed By: manicakes

Differential Revision: D6388270

Pulled By: rnystrom

fbshipit-source-id: e5e7e047bad5f21b81b562ebd586f7f5036325ff
2017-11-21 13:18:12 -08:00
Igor Vasilenko
a0cf76c757 Added support UICollectionElementKindSectionFooter for IGListCollectionViewLayout
Summary:
**Changes occurred only for the IGListCollectionViewLayout.**

**Specifically:**
1. Harnessed the hardcore to the fact that it is possible to use only headers.
2. Assertions removed
3. Caching for layout of attributes of footers
4. Implemented the location of the footers in any orientation scroll

Issue fixed: #898

I need this enhancement ASAP 🙏

**Example:**
Footers with user comments count
![simulator screen shot - iphone 6 - 2017-11-14 at 13 35 22](https://user-images.githubusercontent.com/7735730/32775551-c69868cc-c940-11e7-8307-ae2e353519ff.png)

- [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)
- [x] I updated example project with implemented feature
Closes https://github.com/Instagram/IGListKit/pull/1017

Reviewed By: jeremycohen

Differential Revision: D6385893

Pulled By: rnystrom

fbshipit-source-id: 5f1bad5655d2df321f8c71496aa797ac8e3d226a
2017-11-21 12:45:38 -08:00
Ryan Nystrom
2f17cb5fdf Revert D6264886: [IGListKit][PR] Make sure collection have unique ListDiffable objects on initial data…
Summary:
This reverts commit 5159b7989f1d17fd0a7522d986ed6abf012da77f

bypass-lint

Differential Revision: D6264886

fbshipit-source-id: 54b230fab0e7b1fdf15e065e60f4c3bfd743629b
2017-11-17 12:33:54 -08:00
Maxime Ollivier
82a2a2ee18 added experiment to make [IGListAdapter visibleSectionControllers] a bit faster
Summary:
* Issue: [IGListAdapter visibleSectionControllers] calls [UICollectionViewLayout layoutAttributesForElementsInRect:] which can be expensive. And since visibleSectionControllers is called in scrollViewDidScroll, it can add up and take a toll on scroll performance. On an iPhone 7, it's in 2-10% of the main-thread samples (using Time Profiler).
* Fix: IGListDisplayHandler conveniently keeps track of visible IGListSectionControllers, so let's just use that. Now, [IGListAdapter visibleSectionControllers] drops to ~0.3% of samples.

Reviewed By: rnystrom

Differential Revision: D6351474

fbshipit-source-id: 66914db95e08498927bfbceda4d2e9d58cbc7530
2017-11-16 16:07:29 -08:00
yemodin
319928f697 Make sure collection have unique ListDiffable objects on initial data…
Summary:
… source setup too

Issue fixed: #815

- [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/993

Reviewed By: jeremycohen

Differential Revision: D6264886

Pulled By: rnystrom

fbshipit-source-id: 5159b7989f1d17fd0a7522d986ed6abf012da77f
2017-11-15 11:27:25 -08:00
Saad Ismail
ee7813a730 Fixing Build Issues when Running IGListKit-tvOSTests
Summary:
tvOS Tests were failing because `IGListAdapterUpdateTester` was being used by `IGListAdapterE2ETests` but `IGListAdapterUpdateTester` was not included in the tvOS Target.

Error Msg:
```
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_IGListAdapterUpdateTester", referenced from:
      objc-class-ref in IGListAdapterE2ETests.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

Reviewed By: rnystrom

Differential Revision: D6251880

fbshipit-source-id: 463452c2206bac79e9c5738306b61c693ea580ca
2017-11-07 13:06:58 -08:00
Saad Ismail
d6e26d54e8 IGListDiffKit
Reviewed By: rnystrom

Differential Revision: D6201376

fbshipit-source-id: c7d2e643de5329f00f6d7a2bec4f0fc86e81f27b
2017-11-06 17:02:06 -08:00
Rizwan Mohamed Ibrahim
b3ffafc018 Adds header docs to listener API in IGListAdapter #trivial
Summary:
Issue fixed: #997

- [X] 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/1000

Differential Revision: D6233518

Pulled By: rnystrom

fbshipit-source-id: ba944c29d094ac83554a97326bc5212ef1fd8671
2017-11-03 13:41:03 -07:00
Ryan Nystrom
8cffc50d7d Copy and nil block queue before executing #trivial
Summary:
Discovered in rnystrom/GitHawk#781 and introduced in d9a89c9b00. Can't repro in unit test, but have obvious stack traces (see GitHawk issue) that collection is being mutated while enumerated.

No changelog since this is a new fix for 3.2.
Closes https://github.com/Instagram/IGListKit/pull/995

Reviewed By: manicakes

Differential Revision: D6206957

Pulled By: rnystrom

fbshipit-source-id: c42e3688d0f2b31693199f8015b5de48b7b3b9e6
2017-11-03 11:29:41 -07:00