351 Commits

Author SHA1 Message Date
Jesse Squires
895de471ba Regenerate docs, move docs build script
Summary:
- Move docs script to `scripts/`
- Add small note on README about regenerating docs
- Re-gen docs (doing this because of all the recent spelling, etc. fixes -- note, no breaking changes have landed, so we're good to re-gen.)
Closes https://github.com/Instagram/IGListKit/pull/797

Differential Revision: D5162705

Pulled By: rnystrom

fbshipit-source-id: 83cb0f171c10526a8a4b5d8a746fc2226987f256
2017-05-31 21:01:49 -07:00
Joseph Ortiz
81955e4106 Remove white space
Summary:
Issue fixed: #770

- [ ] All tests pass. Demo project builds and runs.
- [ ] 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/783

Differential Revision: D5137558

Pulled By: rnystrom

fbshipit-source-id: e8c94d5d6d0ffde4f283915a21cd015604938c88
2017-05-27 08:17:59 -07:00
Daniel Alamo
e278e6c27f Insert comma after "At Instagram" in readme.md
Summary:
Issue fixed: #762

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

Differential Revision: D5129315

Pulled By: rnystrom

fbshipit-source-id: d63e37c75ba633899ea8759c7c9c1baf023b1e2b
2017-05-26 08:17:15 -07:00
James Sherlock
b71c346f66 Amend swiftlint to work with older installations
Summary:
![image](https://cloud.githubusercontent.com/assets/15193942/26492070/41f53338-420a-11e7-8ed6-f5d9872338c4.png)

Noticed an issue when trying to build the examples project that I couldn't because of the Swiftlint build phase (see the image above)

As it turns out in between the version I have installed (0.16.1) and the latest (0.19.0) they've made it so you can drop `lint` from the command (which is the default task).

I see two options really:
1. We add `lint` to the command which at least lets older versions of Swiftlint compile the project without making changes to run phases. It's worth noting that this means that certain (newer) rules won't be detected.
2. We add a way of detecting if they have an older version (likely by comparing the output of `$(swiftlint version)` to the version we know it works on. And display a more appropriate message and not fail the build.

Happy to discuss this

heshamsalman jessesquires rnystrom
Closes https://github.com/Instagram/IGListKit/pull/796

Differential Revision: D5137557

Pulled By: rnystrom

fbshipit-source-id: b6c85197d7a66e37976d66b646c9c9241827ce42
2017-05-26 08:17:15 -07:00
Hesham Salman
a5d5213e5b Update Dangerfile to be less noisy, close #792
Summary:
Issue fixed: #792

- [ ] 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.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/795

Differential Revision: D5132076

Pulled By: rnystrom

fbshipit-source-id: 7d68f842e0244d6c6184982ee434dc4da22cc7c6
2017-05-25 13:46:06 -07:00
Rusty Bailey
98218cab58 Fix typo: experiements > experiments.
Summary:
Issue fixed: #773

- [ ] 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.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/776

Differential Revision: D5129343

Pulled By: rnystrom

fbshipit-source-id: 127126545f246e5431636642f203c8150b6a547b
2017-05-25 08:22:37 -07:00
Daniel Alamo
49f1d3e653 Remove ", which will be super fast" from FAQ.md
Summary:
Issue fixed: #763

- [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.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/794

Differential Revision: D5129406

Pulled By: rnystrom

fbshipit-source-id: dcca533130e99d5960781c5c3336a6fdbd399505
2017-05-25 08:22:36 -07:00
James Sherlock
fb5dd116a2 Spelling & General Fixes
Summary:
Closes #771, #768, #767, #766, #765
Closes https://github.com/Instagram/IGListKit/pull/789

Differential Revision: D5129348

Pulled By: rnystrom

fbshipit-source-id: 4f3da39e643adade99fa7549098ff39d6350de17
2017-05-25 08:03:37 -07:00
heshamsalman
4770164599 unintercepted => non-intercepted, close #774
Summary:
Issue fixed: #774

- [ ] 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.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/787

Differential Revision: D5129345

Pulled By: rnystrom

fbshipit-source-id: 2673191f566a189a1374bfcff8a6639e1cb1fa29
2017-05-25 08:03:36 -07:00
Roshan Nindrai
f4cee8060d Fixed typos around 'dequeing'
Summary:
This reverts commit cc039179502b8992da38bfdd984389ace5ebd294.

Issue fixed: #772

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

Differential Revision: D5129335

Pulled By: rnystrom

fbshipit-source-id: 87efbd13b4ba7132f50d6a4de0430190172fd30c
2017-05-25 08:03:36 -07:00
James Sherlock
a8e4f3089c Add script to detect if Jazzy is installed or not
Summary:
Issue fixed: #744

Pretty much same as Swiftlint's check just inverted and made for jazzy!
Closes https://github.com/Instagram/IGListKit/pull/790

Differential Revision: D5129341

Pulled By: rnystrom

fbshipit-source-id: 4cc0f037aeefb216e5e1f82bcfc5da1c9a15caab
2017-05-25 07:46:13 -07:00
William Hoffmann
c2504e0d0e Fix its in FAQ
Summary:
When you want it to be possessive, it's just i-t-s, but when you want it to be a contraction, it's i-t-'-s.

Issue fixed: #764

- [ ] 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.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/781

Differential Revision: D5129333

Pulled By: rnystrom

fbshipit-source-id: c12e15c7403f888384119c78ef632044a054c5e6
2017-05-25 07:46:13 -07:00
heshamsalman
f3be4352d8 Corrected "peform", close #775
Summary:
Issue fixed: #775

- [ ] 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.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/786

Differential Revision: D5129310

Pulled By: rnystrom

fbshipit-source-id: 5ba4f13b0546c2be1231964489e93d1c32e1c89d
2017-05-25 07:33:53 -07:00
Daniel Alamo
0ab9e0323e Change help out to help in readme.md
Summary:
Issue fixed: #761

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

Differential Revision: D5129314

Pulled By: rnystrom

fbshipit-source-id: 3e0f3f9df908966d1e24f3827451a68ef72862f0
2017-05-25 07:33:53 -07:00
Hesham Salman
10007d6dc3 Add starter tasks to readme, close #754
Summary:
Issue fixed: #754

- [ ] 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.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/756

Differential Revision: D5103956

Pulled By: rnystrom

fbshipit-source-id: 212f7b3b7d7a8616d774f787fcb2e7cecf72d0db
2017-05-22 09:02:06 -07:00
Kj Drougge
aacb369c10 fix minor spelling error
Summary:
Minor spelling error

- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/742

Differential Revision: D5069293

Pulled By: jessesquires

fbshipit-source-id: d146c934cbd6eb37400d99ee16bea7e6fa86acee
2017-05-16 07:47:53 -07:00
heshamsalman
02f28fc994 Implemented SwiftLint, new PR
Summary:
Replaces #642, #681

Issue ref: #394

Changes from last PR:
- Deleted the shared SwiftLint folder, incl. all files (On the plus side, did this in the quest to get this PR in https://github.com/realm/SwiftLint/pull/1513)
- Changed the build script such that it runs the user's `HomeBrew` installation of SwiftLint instead of the local copy

Integrates SwiftLint into DangerBot.
You may want to append a ?w=1 to the end of the files-changed url to exclude whitespace-only changes.

- [ ] 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.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/741

Differential Revision: D5068134

Pulled By: jessesquires

fbshipit-source-id: 68d6a57e0072672e38eeb94908d00f26bbd68fbc
2017-05-16 07:31:43 -07:00
Jesse Squires
357a28e5cf final docs update for 3.0
Summary: Closes https://github.com/Instagram/IGListKit/pull/738

Differential Revision: D5052802

Pulled By: jessesquires

fbshipit-source-id: b1ace763da9edbb7bc65ecb9af34aa791e617aa7
3.0.0
2017-05-12 10:46:46 -07:00
Jesse Squires
9d102b9639 Fixup project, update README and guides
Summary:
- Fix OCMock issues with tvOS tests
- Update README/guides
Closes https://github.com/Instagram/IGListKit/pull/737

Differential Revision: D5052333

Pulled By: jessesquires

fbshipit-source-id: 958444d892c14dd4c75e244f20ae21bbfeec8290
2017-05-12 09:47:20 -07:00
Ryan Nystrom
32a566d7c9 Regen docs for 3.0
Summary:
~~Land after #661, #730 and D5031184~~

Rebuild the docs from script. Couple notes:

- Went from 100% to 99%, does that matter? Script output says
  - > 99% documentation coverage with 2 undocumented symbols
  - Looks like `NS_SWIFT_NAME` throws documentation for a loop on `IGListDiffOption` and `IGListExperiment`
- Swift names are different, will that be a problem?

Part of #707

Closes https://github.com/Instagram/IGListKit/pull/728

Differential Revision: D5050951

Pulled By: jessesquires

fbshipit-source-id: 19249c1d34e6f253b911965114fd4ae7458d2684
2017-05-12 07:25:00 -07:00
Jesse Squires
ae60df9290 Update CHANGELOG.md
Summary: Closes https://github.com/Instagram/IGListKit/pull/735

Differential Revision: D5048185

Pulled By: jessesquires

fbshipit-source-id: 3f1a6826a4088043d883533f4f933a0a7ea42d60
2017-05-11 16:18:55 -07:00
Ryan Nystrom
0a416914d5 Rename sectionIndex API to just section
Summary:
Quick rename before releasing 3.0 to get this API in parity w/ `isFirstSection` and `isLastSection`. My b I should have caught this in review.

Closes #720

Reviewed By: jessesquires, amonshiz

Differential Revision: D5031184

fbshipit-source-id: 1cd7b00c8b32084fecd861e78808eea0d0056337
2017-05-11 14:49:59 -07:00
Ryan Nystrom
7304fe820d Fix UICollectionView debug dump script
Summary:
Duh, need to import macro

Issue fixed: #722

- [x] All tests pass. Demo project builds and runs.
Closes https://github.com/Instagram/IGListKit/pull/733

Differential Revision: D5040026

Pulled By: jessesquires

fbshipit-source-id: e9e51137ab4f7fa949667e3f3d644cd5c03abf80
2017-05-11 14:31:28 -07:00
Ryan Nystrom
de0fe91ae7 3.0 migration guide
Summary:
Will add to this as we close out the [milestone](https://github.com/Instagram/IGListKit/milestone/3).

Issue fixed: #475
Closes https://github.com/Instagram/IGListKit/pull/661

Differential Revision: D5047071

Pulled By: jessesquires

fbshipit-source-id: 78989529f50c9b281960e5acf843e91198677432
2017-05-11 13:50:49 -07:00
James Sherlock
a8190f3db1 Update version number in docs
Summary:
Part of #707
Closes https://github.com/Instagram/IGListKit/pull/734

Differential Revision: D5046692

Pulled By: jessesquires

fbshipit-source-id: db43f99fd0bbf4186a1bd47070f28a9a446bc2a4
2017-05-11 13:07:11 -07:00
Ryan Nystrom
f743b1c915 Regen example project files
Summary:
Regen example projects w/ pod script file.

Part of #707

Reviewed By: jessesquires

Differential Revision: D5039135

fbshipit-source-id: d29bcf635aea59aa589bd90644fb1ece6279cc10
2017-05-10 14:01:05 -07:00
Ryan Nystrom
b6217a6709 Proof guides for consisntency and name changes
Summary:
Part of #707
Closes https://github.com/Instagram/IGListKit/pull/730

Differential Revision: D5039060

Pulled By: rnystrom

fbshipit-source-id: d54259b2dddbaba0fe2e69c6dd08a37fd17fbc4a
2017-05-10 13:31:19 -07:00
Ryan Nystrom
d1cd23b3d0 Bump pod and project version to 3.0.0
Summary:
Part of #707
Closes https://github.com/Instagram/IGListKit/pull/731

Reviewed By: rnystrom

Differential Revision: D5036877

Pulled By: jessesquires

fbshipit-source-id: f63ce3369019870df87ebde59d6f6b0e95c8ad87
2017-05-10 12:32:05 -07:00
Ryan Nystrom
2363352f07 Fill in tbd in changelog
Summary:
Part of #707

Closes https://github.com/Instagram/IGListKit/pull/729

Reviewed By: rnystrom

Differential Revision: D5036882

Pulled By: jessesquires

fbshipit-source-id: 2fe99b66608fff52bb42cac46073b32d0865d007
2017-05-10 12:32:05 -07:00
Andrew Monshizadeh
1d140e441a Reset all section controllers when a list adapter is deallocated
Summary:
This change will ensure that section controllers have the following properties reset to sensible default values when their owning list adapter is deallocated.

```
isFirstSection = NO
isLastSection = NO
sectionIndex = NSNotFound
```

Issue fixed: #709

- [X] All tests pass. Demo project builds and runs.
- [X] I added tests, an experiment, or detailed why my change isn't tested. (Existing test is updated to ensure this doesn't regress)
- [ ] 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/723

Reviewed By: rnystrom

Differential Revision: D5032445

Pulled By: jessesquires

fbshipit-source-id: 446a30f4206ce02d3ad89fcd9b4586587f396f58
2017-05-10 10:02:55 -07:00
Bas Broek
f94d01ed17 Add isPrefetchingEnabled to debug description
Summary:
Issue fixed: #725

- [x] All tests pass. Demo project builds and runs.
- [ ] 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/726

Differential Revision: D5032405

Pulled By: jessesquires

fbshipit-source-id: aeda891f09c6aec751daa672258c0b071ea75ae2
2017-05-09 16:20:47 -07:00
Bas Broek
d19b07a0c1 Reference fix PR instead of issue
Summary:
Issue fixed: -

Seem to have referenced the issue instead of the fixing PR during #686.
Closes https://github.com/Instagram/IGListKit/pull/727

Differential Revision: D5032377

Pulled By: jessesquires

fbshipit-source-id: 76ae9b13e6912d8771f413c2f0f3c81e1df42304
2017-05-09 16:02:58 -07:00
Robert Payne
40625f8ff9 Swift name annotations
Summary:
This adds `NS_SWIFT_NAME` annotations to all public API's to provide cleaner integration into Swift:

- Removes the need to prefix classes in Swift code, instead rely on Swift module name spacing
- Adds more argument labels to C function API's like `IGListDiff([], [], .equality)` => `ListDiff(oldArray: [], newArray: [], option: .equality)`

While this is a large API change it should be as easy as:

- Find and replace `(IGList)([^K])` to `List$2` in Xcode with a scope set to Swift
- Build and follow compiler's auto fix corrections for C API's or any missed renames

I have not updated the documentation to reflect this yet, I am totally willing to do so but before I sink that amount of time into it I wanted to see if the Instagram team is even open to this change!

- [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)
- [ ] I have updated the documentation
Closes https://github.com/Instagram/IGListKit/pull/593

Reviewed By: jessesquires

Differential Revision: D5028039

Pulled By: rnystrom

fbshipit-source-id: b473d874a1f9574e56b2ebaabd5b73d1b57d4bab
2017-05-09 14:31:28 -07:00
Ryan Nystrom
a4dfe9676e Fix reusing collection views among multiple adapters
Summary:
When multiple `UICollectionView`s are reused among multiple `IGListAdapter`s (horizontal lists embedded in a bigger, vertical list), the mapping between the old view and adapter is not broken. When a new collection view is attached to the old adapter, an unrelated adapter->collection view reference will be erroneously broken.

The unit test in this diff fails on the second `XCTAssertEqual(adapter2.collectionView, collectionView1);` without this patch.

Issue fixed: #699

t15661237 internally

cc amonshiz since we were talking about this

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

Reviewed By: amonshiz

Differential Revision: D5026330

Pulled By: rnystrom

fbshipit-source-id: b2164a4ab39802f7fba870ceab6692b7b501b5c2
2017-05-09 08:08:46 -07:00
Avner
034f162d6d Typo in the comparison
Summary:
Issue fixed: #

- [ ] 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.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/716

Reviewed By: rnystrom

Differential Revision: D5003529

Pulled By: jessesquires

fbshipit-source-id: e7a0bdcff962f94c33f24f27e1fc9c0a3ed8dbfb
2017-05-05 08:55:43 -07:00
Andrew Monshizadeh
a4e5ad862e Move section index to property
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
2017-05-01 07:28:27 -07:00
Ryan Nystrom
f1ebfbdb7d Disable iOS 9.3 tests
Summary:
These tests are timing out all the time. ☠️

Issue fixed: #683
Closes https://github.com/Instagram/IGListKit/pull/688

Differential Revision: D4965525

Pulled By: rnystrom

fbshipit-source-id: ea122e66379646c557d1b8f1c7325894620b88fb
2017-04-27 14:47:43 -07:00
Jesse Squires
f01594005f Update ISSUE_TEMPLATE.md
Summary:
close #701
Closes https://github.com/Instagram/IGListKit/pull/702

Reviewed By: rnystrom

Differential Revision: D4947884

Pulled By: jessesquires

fbshipit-source-id: 597a8fe21bb8870b8260d10e03bab14651279fe5
2017-04-26 13:17:23 -07:00
Ryan Nystrom
ee4f3c95c6 Balance reload delete and insert calls
Summary:
In 073fc073e0 we deduped delete calls, but since we convert reloads into delete+insert when only deduping deletes, we end up with unbalanced delete+insert calls.

Unit test added reproduced a crash we see internally. Fix passes the test.

Not adding a changelog entry since this is a new regression fixed between releases. #trivial

Issue fixed: t17539856

- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
Closes https://github.com/Instagram/IGListKit/pull/687

Differential Revision: D4933545

Pulled By: rnystrom

fbshipit-source-id: d38a900a99b1aa796dd654ddedb42e3cb4ef4378
2017-04-22 12:15:59 -07:00
Ryan Nystrom
5fe27d8809 Add debug dump scripts
Summary:
Got a little time on the plane to mess around with this idea. Very much want comments on this! Some questions:

- We should probably compile out parts of this using `#if DEBUG`.
  - Should I compile out all of the description methods?
  - Maybe I wrap the entire debug files w/ `#if DEBUG ... #endif` so none of it is loaded?
- ryanolsonk I used [FLEX](https://github.com/Flipboard/FLEX/blob/master/Classes/Utility/FLEXHeapEnumerator.m) for searching the heap, lmk if you see any problems w/ this
  - Its lifted w/ only a few changes for my specific needs (including comments 😂)
  - Chalk us up for using [another bit](https://github.com/Instagram/IGListKit/blob/master/Source/Internal/IGListAdapterProxy.m#L77-L82) of your code
- Added a basic test so that the basics of this work and coverage doesn't tank
  - Anything else I should test?
- Is there more data we should be dumping?
- I have to track batch update state on the updater in order to dump it. If this seems dan
Closes https://github.com/Instagram/IGListKit/pull/617

Reviewed By: jessesquires

Differential Revision: D4929426

Pulled By: rnystrom

fbshipit-source-id: fcba0d6f0b7766485440f208cf70ad39dfc7a42e
2017-04-21 16:46:06 -07:00
Bas Broek
ea5a4cc00f Init without working range size
Summary:
Issue fixed: #414

- [x] All tests pass. Demo project builds and runs.
- [ ] 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)

What should we do with testing? I changed all the occurrences of the old initializer with the new one, so I think this is good to go?
Closes https://github.com/Instagram/IGListKit/pull/686

Differential Revision: D4931986

Pulled By: jessesquires

fbshipit-source-id: d6f0ac6578c11f8ef37ec0e385bc110e3abd7c91
2017-04-21 14:30:46 -07:00
Artem Goncharov
e729ab8211 Fixed empty space bug in CollectionView
Summary:
Fixed situation when cells with small height don't intersect with the _Rect_ and stop the enumeration that cause empty spaces in _collectionView_.

Issue fixed: # [680](https://github.com/Instagram/IGListKit/issues/680)

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

Differential Revision: D4929315

Pulled By: rnystrom

fbshipit-source-id: 4437df21772697a9a6421d213f4fed7b8470371b
2017-04-21 08:20:16 -07:00
Ryan Nystrom
fdbe025fe1 Add base test case class for simpler unit testing
Summary:
Making it simpler to setup tests w/ default config and objects. Less LoC in tests, lower setup cost when creating new test suites.

Should I changelog?

Issue fixed: #183

- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
Closes https://github.com/Instagram/IGListKit/pull/678

Differential Revision: D4921633

Pulled By: rnystrom

fbshipit-source-id: fb4d08acb6ed0ba885cf56ce147f70b304301ff1
2017-04-20 14:36:28 -07:00
Ryan Nystrom
073fc073e0 Prevent duplicate item deletes and drop reload collisions
Summary:
a415ef5552 exposed a bug in `UICollectionView` where its state gets corrupted when deleting the same index path more than once in a single batch update block. This resulted crashes like

```
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x4)
Closes https://github.com/Instagram/IGListKit/pull/657

Reviewed By: jessesquires

Differential Revision: D4913790

Pulled By: rnystrom

fbshipit-source-id: 8f6fcdd2e2438da309fc64ca0ac111b9a0980149
2017-04-19 17:17:41 -07:00
Ryan Nystrom
ad416ecccd Remove refs to IGListSectionType, fix TV app example
Summary:
- Clean up docs
  - Remove `IGListSectionType` and `IGListCollectionView`
- Fix TV app example

Issue fixed: #675

- [x] All tests pass. Demo project builds and runs.
Closes https://github.com/Instagram/IGListKit/pull/676

Differential Revision: D4915634

Pulled By: rnystrom

fbshipit-source-id: 60eb1f1e5ece7fe68f6bf44b465bd5379615d716
2017-04-19 16:21:07 -07:00
Jesse Squires
145327647b 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
2017-04-19 13:00:47 -07:00
heshamsalman
04e6c1bff1 Increased timeout time, close #669
Summary:
Simple find and replace for `waitForExpectationsWithTimeout:15` and `waitForExpectationsWithTimeout:16`

Issue fixed: #669

- [ ] 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.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/670

Differential Revision: D4915711

Pulled By: rnystrom

fbshipit-source-id: 7afd990cd5d18844ec1da08c5335f7138feb0b87
2017-04-19 13:00:47 -07:00
Ryan Nystrom
301f1471c9 Add generic type section controller
Summary: Adding and implementing an example of a new section controller that can be configured with a type. This section controller automatically stores its object in `didUpdateToObject:`, and implementations can trust the type-safety of the object!

Reviewed By: jessesquires

Differential Revision: D4914179

fbshipit-source-id: 39e2dce8ca29a1c0c92dc78eb8c25a7ab0a21978
2017-04-19 12:45:36 -07:00
Ryan Nystrom
3102852ce2 Remove IGListSectionType
Summary:
Removing the `IGListSectionType` protocol and adding default implementations into `IGListSectionController`.

- `numberOfItems` returns 1
- `cellForItemAtIndex:` asserts (have to return a cell)
- `didUpdateToObject:` no-ops
- `didSelectItemAtIndex:` no-ops

Fixes #168

Reviewed By: jessesquires

Differential Revision: D4909585

fbshipit-source-id: 8816702504e3fc0683868914ff4dd20e4af7c166
2017-04-19 08:26:30 -07:00
Ryan Nystrom
4441bd84cc Fix crash when requesting OOB layout attributes
Summary: There's a small crash showing up when requesting an index path that doesn't exist. It's totally valid that this could be requested from a product and not the infra. Should fail gracefully.

Differential Revision: D4911349

fbshipit-source-id: eee8891cf9400b3c3cd5539e839296f393f82354
2017-04-19 08:26:30 -07:00