Summary:
Lets try using `UICollectionViewCompositionalLayout` with IGListKit! It does require some data plumbing, but maybe we can make that simpler in the future. For now, lets keep things simple and see how it feels.
This diff replicates the `MixedDataViewController` example starting with the expandable text.
Differential Revision: D52260529
fbshipit-source-id: 5579b8d6fe5d1f95ed282f821e6555a6a56b1c1c
Summary: To demonstrate some more advanced UI customization with IGListKit, and to help make the sample app look more modern, this diff updates the root Demos view controller to adopt the 'grouped inset' style of lists that was introduced in iOS 13.
Reviewed By: DimaVartanian
Differential Revision: D47050305
fbshipit-source-id: e230bea3c98ecb9f547d4fb04b74f32efcb4d986
Summary:
Adds additional polish and refinement to the initial Demos view controller.
* Adds SF Symbols to each section.
* Correctly selects and deselects cells when in and out split view mode.
* Fixes demo table view cell to adapt to safe area insets correctly.
Reviewed By: fabiomassimo
Differential Revision: D45686668
fbshipit-source-id: 5e24120a0aab5cb3fb9c33b0b0d7c087a56d6304
Summary:
As part of the push for a new public release of IGListKit, I thought it'd be a good idea to go back, review the sample apps and provide some visual updates where possible. There are a lot of modern features of iOS and the other platforms that we can use to improve the look of the sample apps for free. 😁
For starters, this diff adds the standard iOS 11 large titles to the view controllers in the iOS sample app.
Reviewed By: fabiomassimo
Differential Revision: D45685793
fbshipit-source-id: f1846cfce32fb4945a6edf5e1a05c4cafd73dacc
Summary:
The standardized Meta copyright notice is "Copyright (c) Meta Platforms, Inc. and affiliates." and not "Copyright (c) Meta Platforms, Inc. and its affiliates." (Dropping the "its")
This diff updates the copyright notice in each source file to the correct this.
Reviewed By: willbailey
Differential Revision: D44737667
fbshipit-source-id: 643bf36df76723e70d9d826c53cf8f29b8a0c8cc
Summary:
A quick push to fix something I noticed while studying how IGListKit works. This simply replaces "Facebook, Inc" with "Meta Platforms, Inc" in all of the source files where the company copyright notice is posted. This should help bring our external facing projects more in line with our new corporate branding.
There's still a lot more references to "Facebook" as a company in the library (especially around linking to other Meta sponsored open source libraries), but this might need additional scrutiny and review on a case-by-case basis, so let's handle those ones separately.
Reviewed By: lorixx
Differential Revision: D41207363
fbshipit-source-id: 57cdbf5eb1023b41a5f32c0c05e01628686a19fe
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
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
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
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
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
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
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
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
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
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
Summary:
`SingleSectionStoryboardViewController` class should be used rather using `SingleSectionViewController` class twice in `DemosViewController` class
- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/220
Differential Revision: D4204505
Pulled By: rnystrom
fbshipit-source-id: d70922d57943eab5275af1b939176307c8c3cbeb