61 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Andrew Monshizadeh
ae11d6af53 Move UICollectionView(DataSource|Delegate) to category
Summary:
This reduces the quantity of the code within IGListAdapter.m and is a bit more in line with Swift style of putting protocol conformance into extensions.

This does not change functionality just rearranges where code lives.

- [X] All tests pass. Demo project builds and runs.
- [X] I added tests, an experiment, or detailed why my change isn't tested.
- [N/A] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [N/A] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/599

Reviewed By: jessesquires

Differential Revision: D4861777

Pulled By: amonshiz

fbshipit-source-id: eaa31aa9438f3892193aeb8b4ae580ba2960ee8b
2017-04-18 11:21:18 -07:00
James Sherlock
c736a37b5f Fix storyboard example app, Fix example build issue
Summary:
Collection view layout has "user defined runtime attributes" which were left over from the old IG grid layout. I've removed them as we don't use them any more.

Also I couldn't build the project because of the map function in the dependency injection example, so changed that slightly to make it run (tested that and still works)

Issue fixed: #656
Closes https://github.com/Instagram/IGListKit/pull/658

Differential Revision: D4899250

Pulled By: jessesquires

fbshipit-source-id: 04f15399732ce07c6026d07801e228de5d5e47ab
2017-04-17 11:02:36 -07:00
Jesse Squires
a415ef5552 Prevent a crash when inserting the same index twice, re-open of #616
Summary:
Original comment:

If you insert or delete into the same index twice **and** update your data source to reflect those changes, we will squash the insert/delete into a single update because we're using `NSSet` internally.

This becomes very apparent when multiple updates are coalesced.

Issue fixed: #483

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

Differential Revision: D4860479

Pulled By: jessesquires

fbshipit-source-id: 3aa271d90fca21b11201f62cefa8d7fbcef6930f
2017-04-11 15:02:13 -07:00
heshamsalman
6758355f0c Chore/variable accessibility, close #618
Summary:
Issue fixed: #618

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

Differential Revision: D4869624

Pulled By: jessesquires

fbshipit-source-id: a9d5623dbb7a032691f3af5a2abf61adc3a42cd0
2017-04-11 13:46:41 -07:00
Adlai Holler
4a5fd32ad8 Add Nullability to a Few Headers
Summary:
I saw some `!` in the Swift example that we can remove 🙂

Same as I mentioned in my last PR, the iOS examples project can't be opened on my machine, but I believe I updated the examples to be compatible.
Closes https://github.com/Instagram/IGListKit/pull/626

Differential Revision: D4860165

Pulled By: jessesquires

fbshipit-source-id: 74bcac8fc759da8105e658901c3df9e71afc609f
2017-04-10 10:18:20 -07:00
Rune Madsen
d26ceeb7d9 Fix iOS Example xcodeproj file
Summary:
Issue fixed: #630

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

Differential Revision: D4860116

Pulled By: jessesquires

fbshipit-source-id: 8138b50106ae06e06c643ba74451c511f38b0b98
2017-04-10 09:34:21 -07:00
Ryan Nystrom
ba65b56a9b Improve the ObjC demo to reflect best-practices
Summary:
Couple best practices I want to make sure our examples reflect:

- Multiple cells in a section controller
- Unique models returned in `objectsForListAdapter:` (no dupes!)
- Dynamic item count (`comments` array)

Issue fixed: #595

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

Differential Revision: D4852192

Pulled By: jessesquires

fbshipit-source-id: f4a89800f90e6b5ea4b6dd7c0d9a78ca5d65082c
2017-04-07 11:33:43 -07:00
Ryan Nystrom
49bf24693d Demo for dependency injection and announcing changes
Summary:
Created a new demo that shows off how to:

- Inject dependencies to section controllers
  - Objects shared between section controllers
  - Things that aren't the core "object"
- Announce changes from the VC that make their way to the section controllers
  - Without calling updates
Closes https://github.com/Instagram/IGListKit/pull/612

Differential Revision: D4827188

Pulled By: rnystrom

fbshipit-source-id: 9575df0e105fd06f9a59db49432b19e8b824e0e3
2017-04-04 10:16:39 -07:00
Andrew Monshizadeh
2ac81d4c37 Generics are now necessary on the IGListBindingSectionController object
Summary:
PR #602 added generics to `IGListBindingSectionController` in the ObjC code but did not update the Swift Examples. Swift fails to compile without any form of generic specification.

Fixed example compilation.

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

Differential Revision: D4818132

Pulled By: rnystrom

fbshipit-source-id: 8ccdab044ac68d2a95085faedf683ac1b882cbff
2017-04-02 20:30:57 -07:00
Jesse Squires
2284ce3897 kill IGListCollectionView. GH issue #409 (redo of D4640425)
Summary:
Take 2. Remove `IGListCollectionView` per #409. Use plain old `UICollectionView`.
(This re-applies D4640425 and updates as needed.)

Also:
- run `pod update` everywhere
- update changelog

Reviewed By: paulvanderspek

Differential Revision: D4812207

fbshipit-source-id: 1ddbae06cdeddb43d8af175d3e8a045a36ff150e
2017-03-31 14:54:09 -07:00
Ryan Nystrom
623ff2a8a8 Container size doesnt use content inset, add new APIs
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
2017-03-30 09:35:03 -07:00
Ryan Nystrom
a15ea08614 Move section controller mutation API to object provided in update block
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
2017-03-22 12:46:49 -07:00
Nikolai Johan Heum
353d90f397 fixed broken example project
Summary:
- The recent addition of `IGListCollectionViewLayoutInternal.h` in a80245a696 broke the example project. This PR fixes this.
- Name sorted the internal files

- [x] All tests pass. Demo project builds and runs.
- [x] Why didnt Travis catch this? 🤔
- [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/569

Differential Revision: D4740682

Pulled By: rnystrom

fbshipit-source-id: 2c57d03f9751d14edf35741eaa97d0ae8a2f167a
2017-03-20 14:48:14 -07:00
Ryan Nystrom
79348164a7 Auto diffing section controller
Summary:
Started work on the plane to get this moving since #418  is up and ready to land. We'll likely need to spend some time fleshing out the API of this, and I think I'll split it up into a couple different PRs once ready for review. Putting this up now to get early feedback.

This adds an auto-diffing section controller as outlined in #38. There are several key parts:

- Subclass a new section controller `IGListAutoSectionController` (naming wip)
- Connect a data source
- Implement the data source methods that do 3 things:
  - Given a top-level object, transform it into an array of **diffable** view models
  - Given a view model, return a cell
  - Given a view model, return a size for a cell
- A new protocol for the cell `IGListBindable` so that we can control when the cell is updated w/ the view model.
  - The most important part of this is that it unlocks moving and reloading a cell, which you can't do w/ `UICollectionView`

- [ ] Unit test `reloadObjects:`
- [x] Add
Closes https://github.com/Instagram/IGListKit/pull/494

Reviewed By: amonshiz

Differential Revision: D4696966

Pulled By: rnystrom

fbshipit-source-id: f21b8341b3ed4389f2a4a106d0d316f481ba6943
2017-03-15 07:47:24 -07:00
Nikolai Johan Heum
a7855d15ac consistent use of finall class
Summary:
You are already using `final class` as the default swift declaration as I guess most people agree this is best practice for classes you are not planning to inherit from :) So I just made the example code more consistent.

I will not add much more reasoning to why, other than open source projects like this is a _big_ inspirations and starting ground to play with swift for new develoeprs joining the iOS community. Nuding them to ask the right questions (composition vs inheritance) early could only be a good thing (?)

- [X] All tests pass. Demo project builds and runs.
- [X] No new tests. No new classes.
- [X] No breaking changes.
- [X] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/539

Differential Revision: D4696591

Pulled By: rnystrom

fbshipit-source-id: 73539b907452ec0cb7a8e842a95cb4fd27138f2f
2017-03-12 13:17:54 -07:00
Ryan Nystrom
139507325c Fix examples
Summary:
Broke in #525 b/c didn't run `pod_install.sh` after adding new files.

Issue fixed: #537
Closes https://github.com/Instagram/IGListKit/pull/538

Differential Revision: D4695675

Pulled By: rnystrom

fbshipit-source-id: 3edc6e25f545efdc5475035036e25bb0e1b304d3
2017-03-11 13:31:28 -08:00
Leyla Hujer
68a264d29c Revert D4640425: [IGListKit] kill IGListCollectionView. GH issue #409
Summary: This reverts commit 871b75eaeb1c9f2a40fe8f3fd81b209661704587

Differential Revision: D4640425

fbshipit-source-id: 4b0e8a9820891062cf7f8d13de13d678adb5df4a
2017-03-06 16:15:31 -08:00
Jesse Squires
3fb2ac0d60 kill IGListCollectionView. GH issue #409
Summary: Remove `IGListCollectionView` per #409. Use plain old `UICollectionView`.

Reviewed By: rnystrom

Differential Revision: D4640425

fbshipit-source-id: 871b75eaeb1c9f2a40fe8f3fd81b209661704587
2017-03-06 15:01:01 -08:00
Ryan Nystrom
6bdcac81d8 Layout invalidation API
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
2017-02-21 15:30:56 -08:00
charles
1f33a77412 Add Example-iOS in ObjC
Summary:
Related issue: [#425](https://github.com/Instagram/IGListKit/issues/425)

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

Differential Revision: D4589989

Pulled By: rnystrom

fbshipit-source-id: df91f10e0896dfe2f39a643f68e7ebd91e8461cb
2017-02-20 16:18:21 -08:00
Sean Doran
640b67ebb4 Optimized images
Summary:
Used [ImageAlpha](https://pngmini.com) and [ImageOptim](https://imageoptim.com) (through [ImageOptim-CLI](https://github.com/JamieMason/ImageOptim-CLI)) to squeeze out all the bytes.

**Was:**
463.424kb

**Now:**
435.785kb

**Savings:**
27.639kb (5.00%)

**Quality:**
99.99615555%
Closes https://github.com/Instagram/IGListKit/pull/500

Differential Revision: D4589974

Pulled By: rnystrom

fbshipit-source-id: d274be035a79f90b57b65eaefb8c1b4d822b604d
2017-02-20 16:18:20 -08:00
Ryan Nystrom
a5a08d2e11 Remove IGListGridCollectionViewLayout
Summary:
Follow from #450, this layout has been replaced. You served us well!

- [x] All tests pass. Demo project builds and runs.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
Closes https://github.com/Instagram/IGListKit/pull/482

Differential Revision: D4553897

Pulled By: rnystrom

fbshipit-source-id: caccb386ba8914fbbf5e81d997524efb78c6e4ea
2017-02-13 14:30:58 -08:00
Ryan Nystrom
e2c2d3dcec Vertical UICollectionViewLayout supporting inline sections (take 2)
Summary:
Working on porting our collection view layout to IGListKit. I'm doing this because its a solid layout, and we just finished preparing it to work with inline sections. It is designed to work in tandem with IGListKit, so we're adding it.

This is still a WIP as I add more tests, but I'd love as much feedback as possible.

Aside from the glob of header documentation, this has the following features:

- Infinite sections that each have infinite items. Sections and items can fall inline. When they break the width of their container they will fall on the next row.
- Sections can have their own insets, line spacing, and interitem spacing.
- Sticky header support! When you use headers, it will always newline the section.
- Maximum width with a border decoration view
  - Use this to pinch in your content on larger devices

Followup to #423

- [ ] ~~Move decoration view support to delegate~~ removed
- [x] Unit test changing [top y sticky inset](https://coveralls.io/builds/9977284/source?filen
Closes https://github.com/Instagram/IGListKit/pull/484

Differential Revision: D4547760

Pulled By: rnystrom

fbshipit-source-id: 879e2da16eb78bb6a90967e77d9ad0bbf7c69594
2017-02-10 18:01:22 -08:00
Ryan Nystrom
80ad941369 Revert D4521797: [IGListKit][PR] Vertical UICollectionViewLayout supporting inline sections
Summary: This reverts commit 20b36ae573d38ca3125a6f3d5faec181c290ab94

Differential Revision: D4521797

fbshipit-source-id: 447de6cf2b30de9c2109dffb266326aceceec7fc
2017-02-10 11:33:07 -08:00
Ryan Nystrom
727833409f Vertical UICollectionViewLayout supporting inline sections
Summary:
Working on porting our collection view layout to IGListKit. I'm doing this because its a solid layout, and we just finished preparing it to work with inline sections. It is designed to work in tandem with IGListKit, so we're adding it.

This is still a WIP as I add more tests, but I'd love as much feedback as possible.

Aside from the glob of header documentation, this has the following features:

- Infinite sections that each have infinite items. Sections and items can fall inline. When they break the width of their container they will fall on the next row.
- Sections can have their own insets, line spacing, and interitem spacing.
- Sticky header support! When you use headers, it will always newline the section.
- Maximum width with a border decoration view
  - Use this to pinch in your content on larger devices

Followup to #423

- [ ] ~~Move decoration view support to delegate~~ removed
- [x] Unit test changing [top y sticky inset](https://coveralls.io/builds/9977284/source?filen
Closes https://github.com/Instagram/IGListKit/pull/450

Reviewed By: jessesquires

Differential Revision: D4521797

Pulled By: rnystrom

fbshipit-source-id: 20b36ae573d38ca3125a6f3d5faec181c290ab94
2017-02-10 08:30:33 -08:00
Jesse Squires
279f348a4a Added object to single section selection delegate callback
Summary:
- Updated selectionDelegate to pass through the model object
- Changelog entry under 3.0.0 as is breaking change

Try saying single section selection 10 times quick
Dabbing my left toe into some ObjC, so apologies if I violate years of rules

- [ ] Update documentation internally

Closes #396

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

Differential Revision: D4406213

Pulled By: rnystrom

fbshipit-source-id: ba468fa49e75823796a47da6ed7f0e8957db3d75
2017-01-11 15:14:01 -08:00
Jesse Squires
c19379eeda Release 2.1.0 prep
Summary:
Prepping for `2.1.0`

- [x] Bump version numbers
- [x] Rebase this branch after remaining PRs are closed
- [ ] Run `pod install` (**must be done internally**)
- [x] Re-gen docs
Closes https://github.com/Instagram/IGListKit/pull/380

Reviewed By: rnystrom

Differential Revision: D4381222

Pulled By: jessesquires

fbshipit-source-id: 04646168d3c84d0dd2c08f0a357836b9326f8963
2017-01-04 10:14:37 -08:00
heshamsalman
0de9632c0d Fixes search in macOS example, close #371
Summary:
Changed the criteria for starting search in the OS X Example. Closes https://github.com/Instagram/IGListKit/issues/371

Doesn't look like there are tests for the example app. Please ping me if you'd like me to add some. Also, please ping me if you'd like me to add this change to the changelog -- I'm assuming bug fixes to sample apps don't get included there.

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

Differential Revision: D4374006

Pulled By: jessesquires

fbshipit-source-id: 6e20f61aece769240aa63c8949d3c06a0ecd26c8
2016-12-29 14:44:00 -08:00
Sherlock
a748e6f6c7 Changed minimum macOS deployment target to 10.10
Summary:
Worth noting that while we support 10.8 and newer, Swift support is only 10.9 and newer. There were only a few more errors for 10.9 deployment target, but I'm not familiar with how it all works.

Using an `available` to disable row actions for users on 10.10 (only available for 10.11 and newer).
Closes https://github.com/Instagram/IGListKit/pull/374

Differential Revision: D4372977

Pulled By: jessesquires

fbshipit-source-id: 19f4b50c8eb4aa92f80241d69c44a367e854f5e8
2016-12-29 11:13:57 -08:00
James Sherlock
5cd771b546 Added Subspec for Diffing
Summary:
So the main Podspec file now has two Subspecs, `Diffing` and for lack of better name `Default`. `Diffing` is purely the files within the common directories (used for Diffing, if in the future we support MacOS NSCollectionView then this may need changing). `Default` depends on `Diffing` but also adds all the non-common files.

To use it via CocoaPods, nothing changes. You `import IGListKit` and you will only have access to the files in the pod you use. (So if you use `IGListKit/Diffing` in your Podfile, then you will only get access to the diffing files). If you do a manual installation, or I assume via Carthage, then you will need to import the correct header file (either `IGListDiffKit.h` or `IGListKit.h` depending on what you want).

Turns out CocoaPods creates it's own umbrella header (unless you tell it otherwise) meaning our ones are unused by it.

Just to confirm `IGListKit` in your Podfile will give you everything, only if you add `/Diffing` will you "opt-out" o
Closes https://github.com/Instagram/IGListKit/pull/368

Differential Revision: D4367438

Pulled By: jessesquires

fbshipit-source-id: 272318ca551e7e8c4177ca3ca501fde23bd9705a
2016-12-27 12:44:27 -08:00
Sherlock
19d4f9d1f7 Added compatibility header
Summary:
- Added IGListCompatibility.h file, and imported it in the files where we need the target check.
- Ordered the project by type

In "IGListKit.h" we still have the conditional check for `#if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR` - Did we want to make a macro or something for this check?

This is the most Obj-C I've ever done... just felt that was a worthy comment.

Closes #364

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

Differential Revision: D4366344

Pulled By: jessesquires

fbshipit-source-id: f0a6168b8965ded22a641814797fbdec92ca1c36
2016-12-24 10:44:25 -08:00
Ryan Nystrom
1b70435993 Add stacked section controller demo
Summary:
Adding a pretty basic stacked demo. 3 different sections, each with 3 child section controllers that handle an `Int` data.

Requires #354 to be fully functional (working range).

Closes #134

- [x] All tests pass. Demo project builds and runs.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/355

Differential Revision: D4363859

Pulled By: jessesquires

fbshipit-source-id: 5dbc8e18388fed4930f189e3477ff57f0edf2d13
2016-12-22 14:29:08 -08:00
Jesse Squires
4e42712e5b fixup common files and podspec, #270
Summary:
- Add missing common files
- Fix podspec for common files
- Pod install all examples

Reviewed By: rnystrom

Differential Revision: D4350871

fbshipit-source-id: 708ebe6ce66caed75af5b2ac18920dcf45567d16
2016-12-19 21:44:13 -08:00
Ryan Nystrom
ad30e53507 Move macOS and diffing files to Common dir
Summary:
Moving files to `Common` dir so changes are more automated with Buck and easier to manage in the long run. Ran `pod install` on test and example targets. Updated buck file to include `Common` so diffing lib still works.

Part of #270

Reviewed By: jessesquires

Differential Revision: D4346722

fbshipit-source-id: 366d89f6dd571b158b5fccd542080c51517ed341
2016-12-19 12:29:24 -08:00
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
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
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