ra1028 / DiffableDataSources

💾 A library for backporting UITableView/UICollectionViewDiffableDataSource.

Home Page:https://ra1028.github.io/DiffableDataSources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

We're unable to build in Release mode but you have a change on `master` that fixes the issue

craigomac opened this issue · comments

Checklist

  • Reviewed the README and documents.
  • Searched existing issues for ensure not duplicated.

Expected Behavior

We should be able to build in Release mode.

Current Behavior

In Xcode 11.4 only, building the framework in Release mode fails. The error is in SnapshotStructure.swift on line 38: the compiler complains that it resolves Collection to SnapshotStructure.Section.Collection and that this type has no associated Element.

Detailed Description (Include Screenshots)

The change already made on master to Swift.Collection resolves this issue, but it's not yet in a release.

Please can you make a new release including this change?

Environment

  • version:

  • Swift version:

5.0

  • iOS version:

12.1/13.4

  • Xcode version:

11.4

  • Devices/Simulators:

Any

  • CocoaPods/Carthage version:

1.9.0.beta.2 (issue also occurs with latest SPM release)

Same here
Screen Shot 2020-04-06 at 6 24 02 PM

Oh, it looks like It's not just me that has experienced this issue then!

I have found a working solution to this, which is simply adding a namespace to the Collection type. I'm assuming whatever changes that went to the latest Swift compiler prevent it from making sense of this particular generic constraint.

Changing this:

init<C: Collection>(source: Section, elements: C) where C.Element == Item {

into:

init<C: Swift.Collection>(source: Section, elements: C) where C.Element == Item {

has resolved this issue for me (for both Debug and Release scheme).

I'm happy to provide a PR that fixes this.

The change to fix this is already on the master branch of this project. All that needs to happen is for the maintainer to make a release, and we'll be able to compile again using that release as a dependency.

For now, we've resolved it in our app by depending directly on the master branch of this GitHub repo (you can do this from Xcode if you're using SPM or from CocoaPods with a branch argument on the pod dependency).

Noted, I've been using my own fork for a while and I haven't noticed changes to the master branch - hopefully a release will follow.

+1 any news on releasing master @craigomac ?

Sorry for everyone, I completely forget to make a new release 🙏
I will make a new tag, right now

Yes, I used

pod 'DiffableDataSources', '0.4.0'

but

pod install --repo-update

is required to detect new version. Otherwise I was getting error:

[!] CocoaPods could not find compatible versions for pod "DiffableDataSources":
  In Podfile:
    DiffableDataSources (= 0.4.0)

None of your spec sources contain a spec satisfying the dependency: `DiffableDataSources (= 0.4.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.