Heinz M. Heinz M. - 1 year ago 142
Swift Question

Github exyte Macaw-Examples swift compiler error

The Github exyte Macaw-Example generates the following Swift compiler error:

enter image description here

I assume line 457 in SWXMLHash.swift may be the redeclaration.

455 /// Returned from SWXMLHash, allows easy element lookup into XML data.
456 public enum XMLIndexer: Sequence {
457 case Element(XMLElement)
458 case List([XMLElement])
459 case Stream(IndexOps)
460 case XMLError(IndexingError)

Answer Source

I investigated these Macaw and SWXMLHash issues on Github and also this is a Swift 4 bug. Long story short:

Macaw is using the dependency SWXMLHash 3.1, which has this bug. The fix is to use the latest version of the SWXMLHash (4.0 or similar).

Easy solution: use Xcode 8.3.3

Change podspec: go into Macaw.podspec, and change the line s.dependency 'SWXMLHash', '~> 3.0.0' to s.dependency 'SWXMLHash', '~> 4.1.0'

Otherwise:

  • Download last SWXMLHash framework version

  • Copy SWXMLHash.swift and SWXMLHash+TypeConversion.swift from Source folder into your /Pods/SWXMLHash/Source folder.

  • Fix errors (there are a bit of them)

But still, should you choose the last solution - consider risks with Xcode 9, because it is still in beta.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download