Entries with the composed tag

Pull request ComposedSectionProvider fixes on composed-swift/Composed

Opened 22nd September, 2020

These were quite hard to track down since the errors that would occur would often be visual and not a crash, although in some scenarios it did seem to trigger a crash.

I think this highlights the need for a much larger test suite.

Sidebar

It also made me question the insert(_:at:) functions because it's not really clear what the index is. Should it insert it at the index in the context of the sections and providers (as it does now), or just sections?

For example, with:

  • Section A
  • Section Provider
    • Section B
    • Section C
  • Section D
  • Section E

If I insert a section at index 3 should it look like:

  • Section A
  • Section Provider
    • Section B
    • Section C
  • New Section
  • Section D
  • Section E

or

  • Section A
  • Section Provider
    • Section B
    • Section C
  • Section D
  • New Section
  • Section E

Pull request Fix crash when performing update while animating on composed-swift/ComposedUI

Opened 10th September, 2020

The completion block is called when the animation has completed, but at the end of the updates block the data has already been updated (from the perspective of the UICollectionView).

Not calling reset() and setting defersUpdate = false could cause crashes e.g. due to changes being applied multiple times.

The best way to recreate this is to have a series of updates occur very close to each other but with the "Slow Animation" setting enabled in the simulator.

This change might also apply to table views, I have not checked.

The crash would often be along the lines of "Tried to delete section at index 11 but there were only 11 sections" or would occur in elementsProvider(for:) with the error "No UI configuration available for section 11" when performing a non-data change e.g. a reload of a section

Pull request Allow multiple cell types per section on composed-swift/ComposedUI

Opened 24th August, 2020

Sometimes it's useful to have multiple different cell types within a single section, for example to use sticky headers or to reduce to need for many layers of composition (which can be tricky to get animation right for).

This isn't a breaking change for consumers.

I think some of the naming should be improved if this were to be merged.

Draft because I want feedback on the impact of the feature itself rather than specifically the code.

Pull request Add GitHub actions on composed-swift/Composed

Opened 7th July, 2020

This is a copy/paste from https://github.com/JosephDuffy/Persist/, with a couple of small tweaks:

  • Only tests iOS; macOS, tvOS, and watchOS were removed
  • Coverage is not uploaded to Codecov; I don't have permission to add the project
  • Xcode 11.5 is used; this is the latest stable version
  • v2 of the cache action is used; this is the latest stable version

It will do the following:

  • Perform a release when a tag starting with v is pushed
    • v0* or v*- (e.g. v1.1.0-rc1) will be marked as pre-release
  • Build and upload docs to the gh-pages branch as part of releases
  • Run tests against iOS when a commit is pushed

Note that the cache is not as useful as it could be right now; Swift likes to rebuild things based on inodes so the cache is largely (maybe entirely) discarded, but will be useful in a future Swift release.

You'll need to create an orphaned gh-pages branch for the docs since I don't have permissions. I don't think it needs an initial commit, although maybe you can't push an empty branch? I've never tried.

Pull request Set `updateDelegate` when a provider invalidates on composed-swift/Composed

Opened 6th July, 2020

Basic Sections were not propagating updates if added via a call to invalidateAll. This is to address #2.

The issue can be recreated by using a SegmentedSectionProvider when switching to a segment that contains a Section (SectionProvider works I think)

This commit alone is likely not enough to fix this issue; updateDelegate should probably be set to nil for removed Sections, and should probably be set in more places.