Commit graph

104 commits

Author SHA1 Message Date
Kent Sutherland
7256bfb51b Update iOS deployment target to silence Xcode 15 warnings (#1589)
Summary:
## Changes in this pull request

Xcode 15 has moved the iOS deployment target up to iOS 12 (just like https://github.com/Instagram/IGListKit/issues/1573 for Xcode 14). I did not modify the changelog because there's already an entry there for iOS 11 and macOS 10.13.

This also includes a build error fix for IGWarnAssert (dffcd4d0c8). I tried running the unit tests but a number of them are failing from previous changes.

### Checklist

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

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

Reviewed By: fabiomassimo

Differential Revision: D50013207

Pulled By: TimOliver

fbshipit-source-id: 6c7a7b2ca3dd1265f11e85979432eded3292ed06
2023-10-11 21:26:38 -07:00
Tim Oliver
51a3cb140e Refactored inline header function to proper implementation file
Summary:
`objectsWithDuplicateIdentifiersRemoved` was originally defined as a static function entirely within the `IGListArrayUtilsInternal.h` header. However it appears that Xcode can't perform code coverage analysis on implementation code in header files, so the coverage for this function was getting skipped.

This refactors the function so the code is properly arranged in an implementation file.

Differential Revision: D49901041

fbshipit-source-id: cb409343247451028634ca4d3d7b63e5670b5e1a
2023-10-06 03:08:34 -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
b09fc8c775 Add detached source files back to Xcode project
Summary:
I discovered after committing the last stack of diffs (especially after renaming `IGListReloadDataUpdaterTests`) that some of the other test files weren't included in IGListKit's Xcode project.

This diff updates the project file to include all of the previously unlinked test and source files.

Reviewed By: candance

Differential Revision: D45147042

fbshipit-source-id: 3141e15b7bc1d0431b6286f6d966e88bd8f88f2a
2023-04-20 14:26:11 -07:00
Tim Oliver
965025d2d3 Add new test files to IGListKit
Summary: This diff adds several new test classes to IGListKit's test suite, covering a variety of objects and use cases that weren't covered before.

Reviewed By: candance

Differential Revision: D45004015

fbshipit-source-id: 5e6cc3f56e62328173657c09c955c320e6067936
2023-04-17 20:41:49 -07:00
Tim Oliver
610c6d2ba8 Remove unused IGListBatchUpdates class from IGListKit
Summary:
While auditing all of the classes in IGListKit, I discovered that `IGListBatchUpdates` is completely unused. It looks like in the documentation that a new class was introduced to replace it, and it looks like this transition has already completed.

Since it doesn't make sense to cover an unused class, let's delete it. :)

Differential Revision: D45002736

fbshipit-source-id: 45e39f37bf00dc6c4867e9df49cfdfce1252604f
2023-04-17 20:41:49 -07:00
Tim Oliver
501cccc6f0 Provide full test coverage for IGListDiffKit model description strings
Summary:
Five model classes in IGListDiffKit: `IGListBatchUpdateData`, `IGListIndexPathResult`, `IGListIndexSetResult`, `IGListMoveIndex`, and `IGListMoveIndexPath` didn't have 100% test coverage because their `description` debug string methods weren't being tested.

I added a new unit test file specifically for testing description strings in IGListDiffKit wrote a basic test to verify each one.

This brings IGListDiffKit's test coverage back up to 100%.

Differential Revision: D44002058

fbshipit-source-id: ebb1bbb3c9a6d380540fc6bbedf5b8c5e5b254f1
2023-03-21 19:12:01 -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
3a4oT
a1036e06e3 SPM number10 (#1487)
Summary:
## Changes in this pull request

 A better version of https://github.com/Instagram/IGListKit/issues/1465 =)

- SPM support with script-based generations.

- added macOS Catalyst support

 ### Generate SPM layout

1. From **project's root** run:

   `bash scripts/generate_spm_sources_layout.sh`

  2. Commit Changes

 Repeat those steps each time you delete/add the project's files. **Make sure** to have this CI step which will check that `generate_spm_sources_layout.sh` is not broken.

Issue fixed: https://github.com/Instagram/IGListKit/issues/1368 #1406

### Checklist

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

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

Reviewed By: DimaVartanian, candance

Differential Revision: D30428297

Pulled By: lorixx

fbshipit-source-id: 655291ff03445dec9b0b8cd97916f0c88207e9a7
2021-08-31 19:28:37 -07:00
3a4oT
cd0fe69983 Run tests from Xcode12. Github workflow (#1478)
Summary:
## Changes in this pull request

- set header `IGListAdapterUpdaterCompatible.h` to - public which fixed Xcode 12 unit test iOS build.
- include `IGListTransitionData.m` to tvOS trget which fixed Xcode 12 tvOS framework build.
- Added GitHub workflow `CI`.

### 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/1478

Reviewed By: candance

Differential Revision: D25504500

Pulled By: lorixx

fbshipit-source-id: 91f477838f176f662dd74928b75df670a4106968
2021-08-16 13:36:42 -07:00
Nate Stedman
64d9bc570b Add refined Swift wrapper for IGListSingleSectionController
Summary: This API is dependent on dynamic types right now, making it awkward and unsafe to use in Swift. By providing a generic wrapper, we can make it safer to use.

Reviewed By: joetam

Differential Revision: D26057302

fbshipit-source-id: ec5d5ed202900f6171761214900fde1f9615e7f5
2021-01-26 07:34:31 -08:00
Maxime Ollivier
8c839d28c7 udpate xcodeproj and example projects
Summary:
* Added new files to xcodeproj
* Ran `pod install` on example projects

Reviewed By: natestedman

Differential Revision: D23542185

fbshipit-source-id: e0d03f915fa0861860d8ffc2ab8701d761d27069
2020-09-08 09:11:12 -07:00
Peter Meyers
c321831b80 IGListDiffKit should support APPLICATION_EXTENSION_API_ONLY (#1422)
Summary:
## Changes in this pull request

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

This PR checks the box that indicates the framework is safe to be used in App Extensions
<img width="302" alt="Screen Shot 2020-02-08 at 3 27 47 PM" src="https://user-images.githubusercontent.com/3067328/74091722-883e1880-4a88-11ea-8ef4-61199704e1ba.png">

### 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/1422

Differential Revision: D20129657

Pulled By: lorixx

fbshipit-source-id: a39f74b450dcf35adb7d16cd47ee735856d2c728
2020-02-26 16:21:44 -08: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
b5d4560513 Add missing files to Xcode project
Summary: These were added in internal builds (Buck) but broke the external build (Xcode).

Reviewed By: lorixx

Differential Revision: D19141251

fbshipit-source-id: 7dc891ee227e24561e6e4cb20c9c6d20dead5e2d
2019-12-17 13:07:18 -08:00
kinarob
7fe113fea8 Remove useless system version code (#1396)
Summary:
## Changes in this pull request

`Examples/Examples-iOS/Pods/Pods.xcodeproj/project.pbxproj`
`Examples/Examples-tvOS/Pods/Pods.xcodeproj/project.pbxproj`

this change just Xcode 11.2 generated.

This pr aim to remove useless `IGSystemVersion` file.

### Checklist

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

Reviewed By: lorixx

Differential Revision: D18638299

Pulled By: iperry90

fbshipit-source-id: 0b6583f1210e5d1570dd672eed8c59901d6785f6
2019-11-21 09:56:43 -08:00
Koen Punt
97c0ec8e73 use cocoapods cdn (#1386)
Summary:
## Changes in this pull request

This updates the Podfile to use the specs CDN instead of the git checkout, which is more performant (and the default with CocoaPods 1.8 and higher).

### Checklist

- [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.
- [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/1386

Reviewed By: lorixx

Differential Revision: D18572204

Pulled By: iperry90

fbshipit-source-id: d3b721aaff92b18efeef31282cb9204055baec21
2019-11-20 09:24:48 -08:00
Ian Perry
2fa963bfa3 Drop support for iOS 8 (#1381)
Summary:
Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1381

https://github.com/Instagram/IGListKit/issues/1078

Dropping support for iOS 8
- Removed checks for iOS 8
- Updated xcodeproj file
- Updated Travis
- Updated podspec

Reviewed By: bdotdub, lorixx

Differential Revision: D18249291

fbshipit-source-id: eba9814b71e67fdc0ef50fcbc809189d86e8c5fb
2019-11-01 12:40:19 -07:00
Nate Stedman
e4c60650f2 Split IGListKit and IGListDiffKit (#1377)
Summary:
Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1377

This splits the diffing-only components from `IGListKit` out into a separate library, `IGListDiffKit`, allowing them to be used independently of the rest of `IGListKit`. We've found that the diffing components of the library are useful independently of the rest of the `UICollectionView` infrastructure, and separating the libraries allows apps to take advantage of those components without paying the full binary size cost of `IGListKit`. The diffing components are available as a subspec in Cocoapods, and as an independent framework in Carthage and direct Xcode project import (i.e. Git submodules).

This is a breaking change, necessitating a major version bump, although it should have only minor impact for projects using the umbrella header `IGListKit.h`, as that header continues to import the diffing utilities. In particular, for a project using Cocoapods and importing `IGListKit.h`, there should be no code changes required.

Reviewed By: calimarkus

Differential Revision: D18114249

fbshipit-source-id: 363b5a427e32800bbc6e82f897230963b4167245
2019-10-31 08:26:12 -07: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
Qinghua Hong
08bf69cc2f Fix #1275 layouts inconsistency in updateAnimated:completion of IGListBindingSectionController (#1285)
Summary:
## Changes in this pull request

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

This PR is straintforward solution as mentioned in https://github.com/Instagram/IGListKit/issues/1275. When I finished it, I realized that it is not a problem in `IGListCollectionViewLayout Partial Optimization` and `IGListBindingSectionController` deserved it. Maybe `IGListCollectionViewLayout` is rarely used because of great builtin UICollectionViewFlowLayout or cells in section rarely need changing their sizes in practices.

Despite it is not `IGListCollectionViewLayout`'s fault, I think it can be more optimized against `invalidateLayoutWithContext`. I would like to make an another PR to optimize it.

Due to this PR just giving a proposed solution, it lacks of adding tests and changing log. When this solution is accepted, I would like to complete these todos.

### 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/1285

Reviewed By: candance

Differential Revision: D15592807

Pulled By: lorixx

fbshipit-source-id: ae06abce896341509de4f3dfb73b3a7bc0a68c51
2019-06-11 22:29:34 -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
Jesse Squires
0c0b31ad7c Run setup script with CocoaPods 1.5.3 (#1216)
Summary:
- Run setup script with CP 1.5.3
- Update to Xcode9.4 recommended settings
- Fix Xcode warnings about NSUInteger

This way we can avoid these changes on other open PRs/diffs.
Pull Request resolved: https://github.com/Instagram/IGListKit/pull/1216

Differential Revision: D8990061

Pulled By: rnystrom

fbshipit-source-id: ae15a267d7e6f19f71203ac4cd7d80ee966ee48b
2018-07-25 06:47:35 -07:00
Adam Stern
b4c8ea180f give section controllers access to collection view scrolling traits
Summary:
I'd like to be able to access the current collection view scrolling traits inside section controllers. These are expressed as three properties from `UIScrollView`:

`isTracking`, `isDragging`, and `isDecelerating`.

My approach is to add a new struct `IGListCollectionScrollingTraits` with these three values, and expose this to section controllers through `IGListCollectionContext`.

Reviewed By: rnystrom

Differential Revision: D7986814

fbshipit-source-id: 19e9bd3b89545b10238dd060a5af8c5a0f39eb82
2018-05-14 14:56:54 -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
Ryan Nystrom
37c798ac78 Bump min macOS version to 10.11 #trivial
Summary:
Followup from #1068

The `NSIndexPath` methods we use **are not** available <10.11. In theory this has always been "broken" b/c older macOS versions would crash at runtime when trying to use these methods.

Normally this would be breaking change, but I can't imagine anyone is using IGListKit on the mac targeting 10.10 and shipping a working app.

cc jessesquires for thoughts

This should be the last remaining item before we get a green badge.

(note that 10.11 was released 9/30/15 which is about 2 weeks before the public IGListKit release)
Closes https://github.com/Instagram/IGListKit/pull/1080

Differential Revision: D6894369

Pulled By: rnystrom

fbshipit-source-id: e5992c7bba68b21704af6bc8fb889b5427266954
2018-02-03 08:31:28 -08:00
Jesse Squires
95b779a584 Update .travis.yml and lint.sh, try to fix #1060 and lint errors #trivial
Summary:
project:
- fix file target membership issues in framework targets and test targets
- fix private/internal header imports, which shouldn't be `<IGListKit/` apparently
- fix static analyzer errors

travis:
- always install latest swiftlint
- ~~don't cache bundler, attempts to fix #1060~~
- remove markdown link check

swiftlint:
- make script non-failing if *any* version of swiftlint is installed
- warning if incorrect version is installed
- fail if not installed
- remove `scripts/generate_ci_yaml.rb`, we can just set the config file path directly
Closes https://github.com/Instagram/IGListKit/pull/1068

Differential Revision: D6885575

Pulled By: rnystrom

fbshipit-source-id: 51b7baa73feefcea71d870c1220d0382df484199
2018-02-02 13:16:46 -08:00
Ryan Nystrom
1d87526bab Fixup project file corruption
Summary:
Continuing issues raised in #1068. Project file was totally busted for macOS and AppleTV.
Closes https://github.com/Instagram/IGListKit/pull/1079

Differential Revision: D6883599

Pulled By: rnystrom

fbshipit-source-id: 29b118c87ffd302b3e54a47f81305292bd38a8fe
2018-02-02 07:02:04 -08:00
Ryan Nystrom
783adf8014 Fix project, examples, and CHANGELOG from internal changes
Summary:
- Unbreak builds so PRs should work (requires rebase)
- Add CHANGELOG entry
Closes https://github.com/Instagram/IGListKit/pull/1069

Differential Revision: D6839909

Pulled By: rnystrom

fbshipit-source-id: abe0c75b50069ec9aac55b6acb7872fd2c8f04fb
2018-01-29 16:03:58 -08:00
Darren Clark
6e4979f6c4 IGListSingleSectionControllerDelegate: add deselect delegate method
Summary:
Added `-didDeselectSectionController:withObject:` to `IGListSingleSectionControllerDelegate`.

Not sure if it makes sense to make it non-optional in 4.0.0 or not (#909) - I can add the [same note](0f04a07319/Source/IGListBindingSectionControllerSelectionDelegate.h (L40)) to the docs if it is

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

Differential Revision: D6164711

Pulled By: rnystrom

fbshipit-source-id: aa8cfd2bb72a16cb525d875e2cad93888f13c641
2017-12-18 12:45:09 -08:00
yiplee
e63a0e78fe Add new iOS 11 api adjustedContentInset support
Summary:
adopt adjustedContentInset instead of contentInset on iOS 11

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

Reviewed By: manicakes

Differential Revision: D6513703

Pulled By: rnystrom

fbshipit-source-id: 5d718f2cb30361959ca5ba8238746427223cb5fd
2017-12-18 08:51:14 -08:00
Maxime Ollivier
74c5fb3566 Update pods and examples
Summary:
Update pod and examples so project builds when synced

Depends on D6545334

Reviewed By: rnystrom

Differential Revision: D6573821

fbshipit-source-id: b0d4246fa9c0d627ebcd34ac7abd5c8453964037
2017-12-15 09:33:39 -08:00
Saad Ismail
ee7813a730 Fixing Build Issues when Running IGListKit-tvOSTests
Summary:
tvOS Tests were failing because `IGListAdapterUpdateTester` was being used by `IGListAdapterE2ETests` but `IGListAdapterUpdateTester` was not included in the tvOS Target.

Error Msg:
```
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_IGListAdapterUpdateTester", referenced from:
      objc-class-ref in IGListAdapterE2ETests.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

Reviewed By: rnystrom

Differential Revision: D6251880

fbshipit-source-id: 463452c2206bac79e9c5738306b61c693ea580ca
2017-11-07 13:06:58 -08:00
Ryan Nystrom
a6f264fc12 Update project settings and fix errors
Summary:
Updated the main project lib settings for iOS 11, fixed all errors (which are from warnings-as-errors).

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

Differential Revision: D6161473

Pulled By: rnystrom

fbshipit-source-id: 1fd51d8805f9c6483942b44d750b2756efde9376
2017-10-26 11:20:55 -07:00
Ryan Nystrom
5cf01cc0a7 Add update finished announcer API
Summary:
Adding a new API to support adding 1:many listeners to observe when an `IGListAdapter` finishes performing an update event. It supports:

- `performUpdates:`
- `reloadData...`
- Even handling update triggered from //inside// a section controller

Differential Revision: D6108096

fbshipit-source-id: d0b43d83f1963fdbf6ef388685cbd8f6890177fa
2017-10-20 08:57:11 -07:00
Ryan Nystrom
48aff22218 Update examples pods so they build #trivial
Summary:
Fixes examples failing to build after #916. I should have looked at Travis closer, my bad!

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

Differential Revision: D6008573

Pulled By: rnystrom

fbshipit-source-id: 727da8f8e8d1079c7840aa9db1152477bf1058ee
2017-10-09 06:45:45 -07:00
Ryan Nystrom
2f8bcda837 Inhibit all warnings from OCMock #trivial
Summary:
Removing project warnings from third party libs. Mostly from iOS 11 changes.
Closes https://github.com/Instagram/IGListKit/pull/943

Differential Revision: D5890504

Pulled By: rnystrom

fbshipit-source-id: ddda53b57571c46cc5f50e0b2337ec24b98e8261
2017-09-22 12:02:31 -07:00
Weyert de Boer
4f970d2317 Dedupe view models in IGListBindingSectionController
Summary:
Issue fixed: #700

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

Reviewed By: manicakes

Differential Revision: D5872117

Pulled By: rnystrom

fbshipit-source-id: 420190566c0a822834d8a3b64202f6d807e6a487
2017-09-20 18:04:11 -07:00
Ryan Nystrom
65a5e6de05 Fix binding SC deselection crash and publish 3.1.1
Summary:
- Fixed #918 by checking `respondsToSelector:` (boo optionals)
- Cut 3.1.1 for immediate publish

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

Differential Revision: D5748009

Pulled By: rnystrom

fbshipit-source-id: b387b3988abc785f312bc47ac003851283972d7a
2017-08-31 12:51:10 -07:00
Candance Smith
1faf59b302 Added debug dump support to IGListBindingSectionController
Summary:
Issue fixed: #698

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

Differential Revision: D5611625

Pulled By: rnystrom

fbshipit-source-id: d9d54e2a10cf0cfae6cff121c20cc8d24d802716
2017-08-11 09:19:00 -07:00
Ryan Nystrom
451229bd70 Require newline across all targets
Summary:
Internal CI will error on this, adding to project.
Closes https://github.com/Instagram/IGListKit/pull/817

Differential Revision: D5283517

Pulled By: rnystrom

fbshipit-source-id: fed4f58b551a90f51a250f18b3c30b851f4f1953
2017-06-20 16:01:39 -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
Ryan Nystrom
5fe27d8809 Add debug dump scripts
Summary:
Got a little time on the plane to mess around with this idea. Very much want comments on this! Some questions:

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

Reviewed By: jessesquires

Differential Revision: D4929426

Pulled By: rnystrom

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

Should I changelog?

Issue fixed: #183

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

Differential Revision: D4921633

Pulled By: rnystrom

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

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

Reviewed By: jessesquires

Differential Revision: D4913790

Pulled By: rnystrom

fbshipit-source-id: 8f6fcdd2e2438da309fc64ca0ac111b9a0980149
2017-04-19 17:17:41 -07:00
Ryan Nystrom
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