Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
174 views
Welcome To Ask or Share your Answers For Others

1 Answer

I investigated these Macaw and SWXMLHash issues on Github and also this 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...