Search code examples
xcodeswiftswift-playgroundswxmlhash

How can I use a third party library: SWXMLHash in the playground ?


I'm using SWXMLHash to parse an xml file in my project, It works fine in the project but I would like to make some tests in a playground.

I keep having an error when I want to use the library in the playground:

Playground execution failed: test.playground:5:8: error: no such module 'SWXMLHash' import SWXMLHash ^

  • I tried to delete the files in the derived data folder.
  • I tried to clean and build, nothing seems to work.

Solution

  • I finally managed to make the 3rd party library work in the playground by following the steps provided in the apple docs:

    https://developer.apple.com/library/ios/recipes/Playground_Help/Chapters/ImportFramework.html

    I followed the Alternative solution, and now I can use the 3rd party library inside my playground.

    Thanks to David Mohundro the creator of SWXMLHash for the link.