ra1028 / DifferenceKit

💻 A fast and flexible O(n) difference algorithm framework for Swift collection.

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix pod compilation in Xcode 10.2

gaetanzanella opened this issue · comments

I created a blank swift 4.2 project with Xcode 10.2 & cocoapods 1.6.0 and I specified the following Podfile:

platform :ios, '11.0'

target 'Test' do
  use_frameworks!

  pod 'DifferenceKit', '~> 1.0'

end

The project does not compile.

The DifferenceKit project compiles correctly on Xcode 10.2. So it seems to be only related to cocoapods.

Should add spec.swift_version = '4.2' to DifferenceKit.podspec.

Error with Swift 4.2 also. It seems the Swift 5 compiler doesn't like the Collection protocol conformance of StagedChangeset even in compatibility mode.

@BjornRuud +1

extension StagedChangeset: RandomAccessCollection, RangeReplaceableCollection, MutableCollection {
    public typealias Element = Changeset<Collection>

    // ...
}

did the trick in StagedChangeset.swift.

I had to get this working right away in my fork, and created a pull request in case the repo owner wants it.
#57

I face the same problem

PR has been merged, I believe now @ra1028 just needs to do maybe some cosmetic changes in the project itself and then update version on CocoaPods etc.

I'm now installing Xcode10.2 😂
One moment, please.