Commit graph

176 commits

Author SHA1 Message Date
Guilherme Rambo
47fbb72fa6 macOS example app
Summary:
Related issue: #333

I've made a very simple macOS example app. It's just a list of names which can be searched, shuffled or deleted.

I think this is a good starting point for anyone who wants to use this on macOS projects :)

![iglistkitmac](https://cloud.githubusercontent.com/assets/67184/21238494/7245f242-c2ea-11e6-98ea-218a6150d14c.gif)
Closes https://github.com/Instagram/IGListKit/pull/337

Reviewed By: rnystrom

Differential Revision: D4345236

Pulled By: jessesquires

fbshipit-source-id: ce75372263d3f451e34f2c816c14ab6bc82116a7
2016-12-19 10:59:03 -08:00
Ryan Nystrom
1765d68406 Invalidate layout when using reloadData
Summary:
Always invalidate the `collectionViewLayout` when calling `reloadData`. Turns out there are inconsistencies when layout attributes are queries/stored using `UICollectionViewFlowLayout` and `estimatedItemSize`.

Reproduced in unit test, fixed the test.

Closes #305

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

Differential Revision: D4329318

Pulled By: rnystrom

fbshipit-source-id: 91851f6ab170a416810712308727225404ad59ba
2016-12-15 12:14:13 -08:00
Jesse Squires
9600c23d15 run pod install everywhere, gen docs.
Summary:
- Project fixes for macOS support, #270
- Podspec fixes for macOS, #270
- Project test target fixes
- Pod install all examples
- Re-gen docs

Differential Revision: D4327169

fbshipit-source-id: bbe7896f8f50aaf3b8da03d0c21a0fb6f775c7cd
2016-12-14 14:44:10 -08:00
Jesse Squires
b52510559d Fix podspec for macOS support
Summary: Closes https://github.com/Instagram/IGListKit/pull/330

Differential Revision: D4327087

Pulled By: jessesquires

fbshipit-source-id: a63ad7770763d95de1333be130673732706b7e36
2016-12-14 09:44:08 -08:00
Jesse Squires
69c3cc73e7 macOS support follow-up work, #270
Summary:
Progress on #270.

- Setup basic, empty example project
- Setup test target and add tests that work for macOS
- Update changelog
- Update travis-ci
Closes https://github.com/Instagram/IGListKit/pull/328

Differential Revision: D4325876

Pulled By: jessesquires

fbshipit-source-id: 342963ce5103d3980c697655e1f1a9b6f3f1c520
2016-12-13 23:14:07 -08:00
Guilherme Rambo
3da0a6bf84 macOS support
Summary:
Added support for macOS. The macOS target includes only the core diffing functionality so `IGListDiff` can be used on macOS apps.

I have not added the tests because I don't know how you're setting them up, maybe the same tests can be used by adding some `#if os(...)`s to the test files.

I have tested integration on iOS, tvOS and macOS using both Carthage and Cocoapods.
Closes https://github.com/Instagram/IGListKit/pull/235

Differential Revision: D4325423

Pulled By: jessesquires

fbshipit-source-id: 871bf08410061306004872f5feb7a09d362b6bc1
2016-12-13 20:44:07 -08:00
Ryan Nystrom
f7e8bf1634 Fix sentence in readme
Summary:
Nits in the readme, not a full sentence.
Closes https://github.com/Instagram/IGListKit/pull/327

Differential Revision: D4325422

Pulled By: jessesquires

fbshipit-source-id: 6873aef68276107b793934b6b3e06d10fa10a8a4
2016-12-13 19:59:04 -08:00
Ryan Nystrom
86cb59a1f0 Fix changelog link
Summary:
Nit, attribution for svenbacia
Closes https://github.com/Instagram/IGListKit/pull/326

Differential Revision: D4324923

Pulled By: rnystrom

fbshipit-source-id: 2770ea9a5b9de639a0b7c376ad5c91ad81e6b71a
2016-12-13 18:29:03 -08:00
Ryan Nystrom
169c0d6c54 Prevent item reload, delete, insert collisions
Summary:
Adds a new test and fixes an item animation collision that `UICollectionView` throws on. Basically we cannot collide reloads with insert+delete.

The example in the test is trivial, but real-world situations do appear b/c of the coalescence of `IGListAdapterUpdater`. It can queue reloads and deletes/inserts at the same index paths while waiting.

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

Differential Revision: D4322005

Pulled By: rnystrom

fbshipit-source-id: 2247163c13c0873a74ac485efff2d882ca6568f9
2016-12-13 13:44:02 -08:00
Ryan Nystrom
695440ec1f Add more missing unit tests
Summary:
Working on that coverage %. Hustle to ?

Seriously tho, nearly maxed the coverage that is realistic. I think we need to spend some time on the grid layout tho, there are parts untested that also are unnecessary. I should file a 3.0.0 issue to track work on that.

Waiting for CI ?
Closes https://github.com/Instagram/IGListKit/pull/324

Differential Revision: D4319806

Pulled By: rnystrom

fbshipit-source-id: b626abd65ad73709c231671c0c669414eef1660b
2016-12-13 07:29:10 -08:00
Sven Bacia
fb9d8cea8e disables prefetchEnabled by default
Summary:
Disables `prefetchEnabled` by default on `IGListCollectionView` (#318).

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

Differential Revision: D4319761

Pulled By: rnystrom

fbshipit-source-id: a3ea4c3d1d1f3123a60c8168fb333e73ab93cb1e
2016-12-13 07:13:58 -08:00
Ryan Nystrom
626d26839b Update changelog for next release
Summary:
Resetting the changelog for next hotfix release.
Closes https://github.com/Instagram/IGListKit/pull/320

Differential Revision: D4316482

Pulled By: jessesquires

fbshipit-source-id: 924bc4770e2eecb615477696243a261b733e2148
2016-12-12 15:44:01 -08:00
Jesse Squires
478264cbc3 Update README.md
Summary: Closes https://github.com/Instagram/IGListKit/pull/321

Differential Revision: D4315759

Pulled By: rnystrom

fbshipit-source-id: 1be7e5799662874d4b41b738115cdb6cde32ed2a
2016-12-12 14:44:08 -08:00
Jesse Squires
fc56c02cec Update README.md
Summary:
rnystrom - I know you removed this before, but I think we should add it back now that we support > 1 platform. 😄

(and macOS is coming up in #235 )
Closes https://github.com/Instagram/IGListKit/pull/322

Differential Revision: D4314033

Pulled By: rnystrom

fbshipit-source-id: d768d0ce19df0154609ab639f0acb8d95fe2b7da
2016-12-12 11:14:19 -08:00
Jesse Squires
faa4595b56 Update README.md
Summary:
Just a few tweaks, less verbose.

Also -- removed the "manual" installation. I don't think hardly anyone uses this. Plus, I don't think a simple drag + drop would work because of `OCMock`.
Closes https://github.com/Instagram/IGListKit/pull/313

Differential Revision: D4313111

Pulled By: rnystrom

fbshipit-source-id: 4796d94e9f4c853220780074807e902a7390c037
2016-12-12 07:14:10 -08:00
Sherlock
2ca1577f3d Check for broken links in markdown files
Summary:
- Install `markdown-link-check` as a dependency
- Check each markdown file for links, and check them using aforementioned library

Closes #312

A few points of note, I'm not sure if we can use the built-in caching capabilities to cache the library (at the moment it's installed for each build, even though it's only used for 1 -- seems a big waste!). Also a downside of the library is it doesn't really like relative links, we only had one -- so I changed it to be absolute.

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

Differential Revision: D4313106

Pulled By: rnystrom

fbshipit-source-id: a73fef73d7d7b54ddff3d5760756630cedb6a6d6
2016-12-12 07:14:10 -08:00
Jesse Squires
1b187caecd Update CHANGELOG.md
Summary: Closes https://github.com/Instagram/IGListKit/pull/311

Differential Revision: D4307618

Pulled By: jessesquires

fbshipit-source-id: 0698436fdeeec9c6d4a776376572025e6e8e6ee4
2016-12-09 12:43:58 -08:00
Ryan Nystrom
b8d2c3bac0 Update docs with 2.0.0 links and copy, regen docs, pod install tests and examples
Summary: Title

Reviewed By: jessesquires

Differential Revision: D4306896

fbshipit-source-id: 134f3afd92d00bed1dee0b99b4f565a606027bdd
2016-12-09 11:44:36 -08:00
Ryan Nystrom
7f56e0fec0 Update podspec and project version to 2.0.0
Summary:
This needs to land and be part of #307 before that gets merged, right?

Part of #306
Closes https://github.com/Instagram/IGListKit/pull/308

Differential Revision: D4306594

Pulled By: rnystrom

fbshipit-source-id: 59314d669f2d42f7dc7856249cf53b81ca001466
2016-12-09 10:44:02 -08:00
Jeff Bailey
b9ede32f5b Issue #299 Unit tests for IGListCollectionView
Summary:
Add 2 new unit test files for IGListCollectionView.  One is for storyboards and the other for when creating the IGListCollectionView in code.

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

Differential Revision: D4304615

Pulled By: rnystrom

fbshipit-source-id: c6edbcd493fe4ee087ce3d0aee80db484207859d
2016-12-08 20:14:01 -08:00
Jesse Squires
8bfe2fefdd Final re-gen docs for 2.0
Summary:
Using latest jazzy 0.7.3
Closes https://github.com/Instagram/IGListKit/pull/302

Differential Revision: D4299870

Pulled By: rnystrom

fbshipit-source-id: 4c2f343695d91f2bcb9ca99355e101bfe8817a7a
2016-12-08 10:14:23 -08:00
Jesse Squires
ec1a46cdca Fix docs error
Summary:
😳
Closes https://github.com/Instagram/IGListKit/pull/301

Differential Revision: D4299155

Pulled By: rnystrom

fbshipit-source-id: 2bac6824a4d76401cb9eb61a582a734464f9d694
2016-12-08 07:14:04 -08:00
Jeff Bailey
80916636ec Fix for issue #294 - Support for UIAppearance in IGListCollectionView…
Summary:
Updated IGListCollectionView:initWithFrame:collectionViewLayout constructor to support UIAppearance for the backgroundColor property.

Fixes #294

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

Differential Revision: D4292394

Pulled By: rnystrom

fbshipit-source-id: a7c4f0e516728b684993f2651eadcc25001de783
2016-12-07 10:14:01 -08:00
Jesse Squires
4c4fdec562 travis voodoo
Summary:
 magic 

We forgot the lamb's blood last time.

- run UI tests on ~~iOS 9, not iOS 10~~ iOS 10.1
- only pod lint once
- only build examples for major releases, not point releases. (new APIs are rarely introduced in point releases)
Closes https://github.com/Instagram/IGListKit/pull/296

Differential Revision: D4291789

Pulled By: rnystrom

fbshipit-source-id: fcfd84be4e914fbc9d0a723315ae6d3ff7582e70
2016-12-07 06:29:05 -08:00
Ryan Nystrom
e66bd85e32 Fix deselection from stack collection context offset
Summary:
Offset should be relative.

Fixes #279

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

Differential Revision: D4290143

Pulled By: rnystrom

fbshipit-source-id: 8d6dccb821b12700d0d7e8704006ef5371396dfd
2016-12-06 18:59:00 -08:00
James Sherlock
ea98e1b41c Update CHANGELOG.md
Summary:
For the sake of completion I added commit/pr numbers to the rest of the changelog
Finishes https://github.com/Instagram/IGListKit/issues/278

- [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)
- [x] Have a real need to complete minor things
Closes https://github.com/Instagram/IGListKit/pull/293

Differential Revision: D4286735

Pulled By: jessesquires

fbshipit-source-id: 907eec77cc54086daeb52c7c23a097c74f6d0422
2016-12-06 12:44:01 -08:00
Jesse Squires
4aae4edbf8 Update CHANGELOG.md
Summary: Closes https://github.com/Instagram/IGListKit/pull/292

Differential Revision: D4285323

Pulled By: jessesquires

fbshipit-source-id: 1c28a529b6c8477ba1946ea6649077131059cd60
2016-12-06 09:44:10 -08:00
Dave Caunt
394e6c827b Don't set UICollectionView properties in IGListCollectionView
Summary:
Fixes #277
Closes https://github.com/Instagram/IGListKit/pull/285

Differential Revision: D4284679

Pulled By: rnystrom

fbshipit-source-id: 6fae3bc928e0065681ebfce906f9e518f819db89
2016-12-06 06:44:05 -08:00
Ryan Nystrom
0395ca31e9 Add unit tests to reloadData updater
Summary:
Adding a few more missing unit tests.

Closes #185
Closes https://github.com/Instagram/IGListKit/pull/289

Differential Revision: D4284610

Pulled By: rnystrom

fbshipit-source-id: a592fb9c12a3995a62b608f44cdcc693a0f79bec
2016-12-06 05:59:08 -08:00
Ryan Nystrom
10bdfb23f9 Add more unit tests to stack section controller
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
2016-12-05 17:44:02 -08:00
Ryan Nystrom
4baf267354 Add missing adapter tests
Summary:
Couple more unit tests missing from `IGListAdapter`.

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

Differential Revision: D4281952

Pulled By: jessesquires

fbshipit-source-id: da01d22b291071e5b2a7623b263574738456b8b8
2016-12-05 17:44:02 -08:00
Jesse Squires
0a08908f7f Update .travis.yml
Summary:
Close #282
Closes https://github.com/Instagram/IGListKit/pull/283

Differential Revision: D4281950

Pulled By: jessesquires

fbshipit-source-id: 38ceddc1162624515d36eda52f177b958fe7fe3e
2016-12-05 17:14:03 -08:00
Ryan Nystrom
7c3d4999eb Fix crash when reloading section that gets deleted
Summary: Rare, but very real crash that occurs when a reload is manually queued and then the section gets deleted in a diff.

Reviewed By: jeremycohen

Differential Revision: D4267678

fbshipit-source-id: a5bedf77934ff85f76830e3f0123a993fc5d885c
2016-12-05 11:58:58 -08:00
Ryan Nystrom
e1d6f52552 Fix migration code block formatting
Summary:
Closes #280
Closes https://github.com/Instagram/IGListKit/pull/281

Differential Revision: D4274255

Pulled By: rnystrom

fbshipit-source-id: 4bfbf5afc44a5e534372f449e6f3c0e574e7bfc8
2016-12-04 11:29:02 -08:00
Brandon Everett
36363f42aa Create private method in IGListStackedSectionController to get relative index
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
2016-12-03 08:29:14 -08:00
Ryan Nystrom
f2a9d93be8 Add details for 1.0 to 2.0 migration
Summary:
Added migration guide for `IGListDiffable` changes.

Closes #221
Closes https://github.com/Instagram/IGListKit/pull/274

Differential Revision: D4265446

Pulled By: rnystrom

fbshipit-source-id: b98a975a9ef65bca0d46a1011e76834ecf08c681
2016-12-02 06:58:59 -08:00
Jesse Squires
e5afb5b4d0 Add scrolling method on IGListCollectionContext. Close #267
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
2016-12-01 16:14:04 -08:00
Jesse Squires
b994a40bfd project organization, 'sort by name'
Summary: Closes https://github.com/Instagram/IGListKit/pull/271

Differential Revision: D4259848

Pulled By: jessesquires

fbshipit-source-id: 4a7a1159bbb335b88243e4fbc7bf62c54ce7b6dc
2016-12-01 11:59:10 -08:00
Jesse Squires
a604d2e6b5 Update .travis.yml
Summary:
Minor tweaks
Closes https://github.com/Instagram/IGListKit/pull/269

Differential Revision: D4259844

Pulled By: jessesquires

fbshipit-source-id: 5ef676172dad398e49c20feebc7342a7eeb503a0
2016-12-01 11:59:10 -08:00
Daniel Rosado
1ca2ac9cd5 Add UI Testing to Examples-iOS app
Summary:
Add basic UI Testing to Examples-iOS app.
It doesn't cover all the examples yet, but Xcode is reporting ~82% of coverage.

Updated travis.yml to run the UI Tests for only one of the matrix jobs - "OS=10.0,name=iPhone 6s", to try to keep the build times acceptable. Last job took ~3 min for the UI Testing section (being the whole build usually around 40 min).

Was feeling like playing a bit with UI Testing and took the chance to use it here, since rnystrom [showed interest in having it](https://github.com/Instagram/IGListKit/pull/251#issuecomment-262375087).

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

Differential Revision: D4259177

Pulled By: jessesquires

fbshipit-source-id: 77fdaf8588e090e4b13836a127d9f6d838248163
2016-12-01 10:44:01 -08:00
Jesse Squires
072cff5cfe gen docs for equality guide updates.
Summary: Re-gen docs for equality guide updates.

Reviewed By: rnystrom

Differential Revision: D4251727

fbshipit-source-id: b646c9b5c82a47c5a2734afe96d935de333ee4fd
2016-11-30 18:14:09 -08:00
Jesse Squires
94a764b5d6 add example setup script. run pod install.
Summary:
- Add script for example setup
- Run pod install and check-in changes

Reviewed By: dshahidehpour

Differential Revision: D4250015

fbshipit-source-id: 51e7342d698bc9874bbbcfb8e784fe62e82d1ac6
2016-11-30 06:44:02 -08:00
Jesse Squires
45933665cf Update IGListDiffable and Equality.md
Summary:
Some minor tweaks and improvements to this guide. 😄
Closes https://github.com/Instagram/IGListKit/pull/265

Differential Revision: D4235752

Pulled By: jessesquires

fbshipit-source-id: 03adec7750ac8ded23542db97b9506ff7dc00adf
2016-11-27 17:43:58 -08:00
Jesse Squires
6f879dd34e re-gen docs
Summary: Closes https://github.com/Instagram/IGListKit/pull/264

Differential Revision: D4235666

Pulled By: jessesquires

fbshipit-source-id: 2adb3e5b656d112fe4f2c106721a5d4b9085337a
2016-11-27 16:59:00 -08:00
Shukhrat Tursunov
67eaf0e999 Focus in tvOS app
Summary:
fixed #261
Closes https://github.com/Instagram/IGListKit/pull/262

Differential Revision: D4235651

Pulled By: jessesquires

fbshipit-source-id: 9777927d2c1c89ad838197fc10db81a069bbf197
2016-11-27 16:59:00 -08:00
Ryan Nystrom
1c44991e62 Add equality guide
Summary:
Fixes #253
Closes https://github.com/Instagram/IGListKit/pull/257

Differential Revision: D4232269

Pulled By: jessesquires

fbshipit-source-id: 3098010007da7cede7cede4c162f3d1614418f7e
2016-11-24 15:44:04 -08:00
Jesse Squires
5d7fc238ae Update CHANGELOG.md
Summary: Closes https://github.com/Instagram/IGListKit/pull/259

Differential Revision: D4232271

Pulled By: jessesquires

fbshipit-source-id: 07a74191650ca898b9f9bb662306c16543b6ed14
2016-11-24 15:44:04 -08:00
Jesse Squires
ead9d26a19 Fix links in README, close #256
Summary: Closes https://github.com/Instagram/IGListKit/pull/258

Differential Revision: D4232202

Pulled By: rnystrom

fbshipit-source-id: 947aebcca15fdef7db5def9eb6d0e0b7253624e9
2016-11-24 13:58:58 -08:00
LinkThrow
552053a5da Broken link to full 'LabelSectionController.swift'
Summary:
- [ ] All tests pass. Demo project builds and runs.
- [ ] I added tests, an experiment, or detailed why my change isn't tested.
- [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)

Replaced with direct link in repo
Closes https://github.com/Instagram/IGListKit/pull/254

Differential Revision: D4231946

Pulled By: rnystrom

fbshipit-source-id: 75635e12cd8f4f047d8afc0d6dd6008136bd5d26
2016-11-24 10:29:04 -08:00
Ryan Nystrom
ca15e29cf1 Skip reloading objects that are not found
Summary:
Even with the assert, we will add `NSNotFound` to the set which will crash. Instead, skip adding the value in case a consumer is using a reference to an object that doesn't exist anymore.

Also, should be using `continue` if a section controller isn't returned by the data source.

Reviewed By: jessesquires

Differential Revision: D4226771

fbshipit-source-id: ed6df0992fdef611dd8fae64f4716e296df11f9a
2016-11-23 16:28:58 -08:00