Commit graph

38 commits

Author SHA1 Message Date
Krys Jurgowski
15b45d0d80 Example using SwiftUI with compositional layout
Summary: Introduces a compositional layout example that leverages section controller methods to determine layout.

Differential Revision: D71402637

fbshipit-source-id: 1179abf13157fb5cb78c8a9086718d1216fb4276
2025-03-19 10:14:23 -07:00
Maxime Ollivier
d01784bd66 add swipe action to UICollectionViewCompositionalLayout example
Summary: Lets add swipe to delete.

Differential Revision: D52262785

fbshipit-source-id: b95cdee116374c561967dd585d02110a4d877e16
2023-12-19 07:17:30 -08:00
Maxime Ollivier
309e1d7e2b add horizontal row to UICollectionViewCompositionalLayout example
Summary: Lets go even beyond the `MixedDataViewController` example by taking advantage of `orthogonalScrollingBehavior`. Really neat!

Differential Revision: D52260531

fbshipit-source-id: aee8b38a38284104fa65ba8d33426a9e6216e503
2023-12-19 07:17:30 -08:00
Maxime Ollivier
6117cda80c add user to UICollectionViewCompositionalLayout example
Summary: Adding user cell

Differential Revision: D52260532

fbshipit-source-id: ec3f4f5a70d02e0c6db713ade51938413cb5ee8a
2023-12-19 07:17:30 -08:00
Maxime Ollivier
7fe78a887d add grid to UICollectionViewCompositionalLayout example
Summary: Adding a grid

Differential Revision: D52260530

fbshipit-source-id: 82e0ef4c1b0cad4a95e0c802d783d7c3f44c5f3b
2023-12-19 07:17:30 -08:00
Maxime Ollivier
77a4582ce5 create UICollectionViewCompositionalLayout example
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
2023-12-19 07:17:30 -08:00
Tim Oliver
596b77877b Update all example apps and related schemes for Xcode 15
Summary: Updates the iOS, macOS and tvOS example apps Xcode projects to be based off Xcode 15 with all appropriate new build configurations.

Reviewed By: fethica

Differential Revision: D50294914

fbshipit-source-id: b6b292ec53e4ab9f336c23e81af3fc6815881398
2023-10-13 22:50:38 -07:00
Tim Oliver
6ab6109779 Polish Demos view controller
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
2023-07-19 22:08:21 -07:00
Tim Oliver
1e48bf9141 Add split mode to iPad
Summary: Updates the sample iOS app with `UISplitViewController` to enable split view functionality on iPad, and larger screen iPhones.

Reviewed By: fabiomassimo

Differential Revision: D45687142

fbshipit-source-id: 171cf7f3306b64db92216dded5c129fa15fd97b3
2023-07-19 22:08:21 -07:00
Kent Sutherland
3cd3a111dd Update deployment targets to silence Xcode 14 warnings (#1573)
Summary:
## Changes in this pull request

Xcode 14 changed the minimum deployment target to iOS/tvOS 11.0 and macOS 10.13. This PR moves up the deployment targets so that a warning isn't shown on every build.

I also silenced the development region and base localization warnings.

### Checklist

- [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/main/.github/CONTRIBUTING.md)

Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1573

Differential Revision: D45223095

Pulled By: TimOliver

fbshipit-source-id: 57fbd284809c09f86a9731d0676332de35fbe0df
2023-05-01 22:48:23 -07:00
Tim Oliver
9e457c39da Update SwiftLint and make it an optional dependency
Summary:
Fixes one final friction point for the IGListKit sample apps: SwiftLint.

At the moment, building the sample apps will hard fail if SwiftLint isn't presently installed. This is generally a good thing when adding new code to the sample apps, but for developers who might want to simply run the sample apps to try out IGListKit, this potentially adds additional unneeded friction.

Since SwiftLint also runs on each incoming PR on GitHub Actions now, even if a third party contributor submits code that they didn't lint themselves, it will still be verified by the CI.

This diff:

* Updates `lint.sh` to check for the latest version of SwiftLint.
* Makes the message that appears if SwiftLint isn't present a warning, instead of an error.
* Adds the linting script to building the `IGListSwiftKit` framework targets as well.

Differential Revision: D43864872

fbshipit-source-id: f5cc18f3612795ad1cc15cc4b7c0dfd7102639c6
2023-03-13 00:49:15 -07:00
Lvv.me
c9e045c942 Improve SwiftPM support (#1546)
Summary:
This diff imports and refines the PR made by cntrump on GitHub.

The PR introduces the following:

* Sample apps now use SPM instead of CocoaPods to import IGListKit.
* Adds Mac Catalyst as an example target.
* Adds C++ flags to the CocoaPods specs.
* Fixes a script issue that was discovered when regenerating the symlinks.

The PR originally aimed to remove the need for symlinked references to the IGListKit and IGListDiffKit source files, but in testing, I couldn't get it working. It's possible SPM being too strict [on where the headers can be placed to be discovered](https://forums.swift.org/t/how-do-i-specify-the-headers-directory-for-a-objc-target-in-swift-package-managers-package-swift/58531/3).

Additionally, another issue was that the original PR changed all of the `#import` statements to the the modular `import` statements, which is fine for the sample apps, but ended up breaking compatibility for any apps that had modules disabled.

## Changes in this pull request

Improve SwiftPM support:

Build module `IGListDiffKit` and `IGListKit` as Objective-C++.

module `IGListDiffKit`:
    - Source/IGListDiffKit
    - module defined in `Source/IGListDiffKit/modulemap/module.modulemap`
    - requires `-fmodules` and `-fcxx-modules`

module `IGListKit`:
    - depend on `IGListDiffKit`, use `import IGListDiffKit;`
    - Source/IGListKit
    - module defined in `Source/IGListKit/modulemap/module.modulemap`
    - requires `-fmodules` and `-fcxx-modules`

module `IGListSwiftKit`:
    - depend on `IGListKit`, use `import IGListKit`
    - Source/IGListSwiftKit

Deleted `spm/` and `scripts/generate_spm_sources_layout.sh`, it is unnecessary.

Updated `.podspec`, add `'OTHER_CFLAGS' => '-fmodules'` and `'OTHER_CPLUSPLUSFLAGS' => '-fcxx-modules'`.

Add missing swift files for `IGListSwiftKit` in `IGListKit.xcodeproj`

### How to use

Replace `#import <IGListDiffKit/IGListDiffKit.h>` with `import IGListDiffKit;`, because `IGListDiffKit.h` isn't exist in `modulemap/`, Or create a symbol link by `ln -sf ../IGListDiffKit.h` for support it ?

### Examples

Use SwiftPM for building examples.

### Checklist

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

Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1546

Test Plan: Test PR showing running tests: https://github.com/TimOliver/IGListKit/actions/runs/4339956050/jobs/7578047058

Reviewed By: lorixx

Differential Revision: D33592395

Pulled By: TimOliver

fbshipit-source-id: 8f7b1873f2b1c6a80908bb55b123e31bea13bb0c
2023-03-06 23:29:41 -08:00
dirtmelon
019b22da07 Adapts to dark mode for iOS example project. (#1453)
Summary:
## Changes in this pull request
### Checklist

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

Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1453

Reviewed By: lorixx

Differential Revision: D23836038

Pulled By: joetam

fbshipit-source-id: 8245415992a5b1ed49f67ebfcf9f85a2745a8042
2020-10-03 01:39:08 -07:00
Koen Punt
f1ceedc39b Refine dequeueReusableCellOfClass methods for Swift (#1388)
Summary:
## Changes in this pull request

Initial suggested implementation for https://github.com/Instagram/IGListKit/issues/1387.

### Checklist

- [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)
Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1388

Reviewed By: lorixx

Differential Revision: D18687735

Pulled By: natestedman

fbshipit-source-id: f9cc70ced3f788771fd3f0443b56befbedb04166
2019-12-19 08:13:22 -08:00
Nate Stedman
d4ec467bac Update examples and tests to Swift 5
Summary: Swift 5 came out a while ago, we should definitely be targeting it.

Reviewed By: lorixx

Differential Revision: D19141252

fbshipit-source-id: d6f8fc5209e721a8b28e569855b5e3cc8b8c3431
2019-12-18 21:51:34 -08:00
Nate Stedman
f367b455a6 Properly split IGListDiffKit and IGListKit podspecs (#1385)
Summary:
Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1385

I attempted to work the two frameworks into a single podspec, but it didn't really work that well. Instead, let's just split them into two podspec files - this should work fine, and more closely follows the Carthage/Xcode behavior.

This should address #1382. Note that the attached project does need to be edited, because we also need to manually specify the `IGListDiffKit` pod location. This issue will go away with the release of 4.0.

Reviewed By: iperry90

Differential Revision: D18449843

fbshipit-source-id: 2750aee1ba39d21b9f1b3521ea8911929ae728b1
2019-11-13 05:30:28 -08:00
Hanton Yang
b01010e5e9 Deprecate IGListStackedSectionController (#1355)
Summary:
## Changes in this pull request

Issue fixed: https://github.com/Instagram/IGListKit/issues/1099

### Checklist

- [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)
Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1355

Reviewed By: Ziewvater

Differential Revision: D17200801

Pulled By: lorixx

fbshipit-source-id: 22bb1abc69b38c9d856621fe848c09e61a9d41ef
2019-09-16 12:28:01 -07:00
Benny Wong
831e9b8809 Fix travis & upgrade cocoapods (#1317)
Summary:
This is a bigger PR than I'd like but there is a bunch of stuff in here that feels like we should land all at once to fix the Travis setup.

Currently, there is a few things wrong. Briefly:
1. Travis is failing to even build the library (see: [build 2298](https://travis-ci.org/Instagram/IGListKit/jobs/506564900))
2. There are legitimately failing tests
3. Travis seems to be flakey running UI tests

This PR deals with the first two.

The Xcode projects were not building because some recently added files weren't added to the xcodeproj (ie. 46a124ddfe and 4662454c4a).

Also added `Foundation.h` import for `bool` definition for `IGSystemVersion` (also a new file)

The main `Podfile.lock` was already being generated via `1.5.3` (0c0b31ad7c) but the `Gemfile` had the wrong version and none of the example project `Podfile.lock`s were re-generated with it.

Once I got the projects correctly building and tests running, I discovered there were a bunch of tests that were legitimately failing. It's unclear when these started failing and what caused it.

I thought it made sense to disable these tests for now and then create Github issues to fix them as starter tasks instead of making this diff even larger.. I can create those if that sounds good.

Somewhat related, it seems like the UI tests on Travis may be a bit flakey. They pass locally, but breaks on Travis [[example](https://travis-ci.com/bdotdub/IGListKit/jobs/195758250)] with error messages like `Failure requesting automation session for com.instagram.IGListKitExamples:85190`

----

- [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)
Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1317

Reviewed By: rnystrom

Differential Revision: D15157375

Pulled By: rnystrom

fbshipit-source-id: b29131f59b74398b6d2b3a73453248cb3325a955
2019-05-01 15:13:25 -07:00
Jared Verdi
f15b167e85 Interactive Reordering
Summary:
I had a desire for interactive reordering in a personal project, so here's a first attempt at adding support in IGListKit.

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

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

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

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

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

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

Issue fixed: #291

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

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

Differential Revision: D6674493

Pulled By: rnystrom

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

- [x] All tests pass. Demo project builds and runs. (source untouched, purely additive)
- [x] I added remodel plugin tests + and a new guide explaining the installation + usage
- [ ] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes https://github.com/Instagram/IGListKit/pull/1083

Reviewed By: rnystrom

Differential Revision: D6937925

Pulled By: calimarkus

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

Differential Revision: D6776177

Pulled By: rnystrom

fbshipit-source-id: 345172237b97aaed0d62312c8f366f46145f8cd9
2018-01-22 12:14:38 -08:00
Igor Vasilenko
a0cf76c757 Added support UICollectionElementKindSectionFooter for IGListCollectionViewLayout
Summary:
**Changes occurred only for the IGListCollectionViewLayout.**

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

Issue fixed: #898

I need this enhancement ASAP 🙏

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

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

Reviewed By: jeremycohen

Differential Revision: D6385893

Pulled By: rnystrom

fbshipit-source-id: 5f1bad5655d2df321f8c71496aa797ac8e3d226a
2017-11-21 12:45:38 -08:00
Ryan Nystrom
f7220b5cfe Update example project files, convert to Swift 4, and fix errors
Summary:
Used migration tool with Swift 4, fixed build errors, and killed all warnings. Only non-trivial change was in the macOS example. Will flag that one.

No changelog needed for this, right?

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

Differential Revision: D5890505

Pulled By: rnystrom

fbshipit-source-id: 7e0d3510ff0e5856a0ffd59f1a97548a72266c20
2017-09-22 06:55:23 -07:00
Ryan Nystrom
0ad49e16f0 Pod install 3.1.0
Summary:
Updating example pods via script
Closes https://github.com/Instagram/IGListKit/pull/911

Differential Revision: D5695840

Pulled By: rnystrom

fbshipit-source-id: 7aaaf9f07e0aa0cccbebbcbd12d9e5a617755cf1
2017-08-23 19:32:17 -07:00
heshamsalman
57bd9e24fe Updated script to pin SwiftLint version
Summary:
Issue fixed: #847

Pinned SwiftLint to 20.1
Closes https://github.com/Instagram/IGListKit/pull/854

Differential Revision: D5407797

Pulled By: rnystrom

fbshipit-source-id: d092e9ff78853d6bb17e6b58d896ab1313e5d3c7
2017-07-12 12:22:40 -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
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
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
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
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
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
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
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
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
879260b417 internal diff for PR #209
Summary: https://github.com/Instagram/IGListKit/pull/209

Reviewed By: rnystrom

Differential Revision: D4190633

fbshipit-source-id: 9d382b9ba3f3d20c8b9c48d900650ec354bc9728
2016-11-16 12:44:19 -08:00