playgroundbooks / playgroundbook

Tool for Swift Playground books
https://ashfurrow.com/blog/swift-playground-books/
MIT License
259 stars 17 forks source link

Using 3rd party libraries in a Playground Book #21

Open damianesteban opened 8 years ago

damianesteban commented 8 years ago

I mentioned this last night on Twitter and I'm happy to work on it. I just want a bit of advice on how you think the best way to approach it would be. I was thinking integration with cocoapods.

Thoughts?

ashfurrow commented 8 years ago

Hmm, CocoaPods might be more than we need. Any files in the Sources directory are compiled with every page, so just dumping the files in RxSwift/Alamofire/etc into that directory should work. A good way to test this would be to:

This was my play for #17 anyway. If that works, then we can change the part of this tool that copies Contents.swift from the playground to the chapter; we would have it also copy any Sources directory, too.

This isn't ideal because each chapter using a library would have its own copies, but I don't think there's a better easy way to use files in both a playground and in a playground book.

Thanks a lot for looking into this! Let me know what parts of the above I can clarify.

damianesteban commented 8 years ago

Sounds like a plan. No thanks necessary, but you're welcome. 😀