Im the author of the structure X and Id like to distribute small pieces of glue code for optional integration with the frameworks Y and Z. Clients should be able to use X as a standalone structure, but able to use integration code if theyre also uses Y and / or Z.
Header question: Is there a best practice for this, and what are the trade-offs? Below are the detailed subqueries.
My specific case: Im the author of Siesta . Integration with SwiftyJSON or with Alamofire requires only a little code. However, Siesta does not require any of these frameworks.
I see two acceptable options:
- Configure the Y and Z frameworks as optional X structure dependencies in my Xcode assembly.
- Distribute individual frameworks : X-core, X + Y glue, and X + Z glue.
Option 1 seems promising at first glance. Isn't that for which optional dependencies? But I'm worried because:
- I do not see additional dependencies in widespread use.
- It is unclear whether I will associate clients with specific versions of Y and Z by doing this.
- How about people using Carthage who build X from the source? It seems that even if they do not use Y or Z, they should include this framework in their
Cartfile.private only for assembly X.
Option 2 is simple, but Im concerned about overhead. Even the night frame works with a frequency of> 250 thousand. Is it still so bad in the last application? Is there any overhead for each infrastructure that should bother me if I go along this route?
Are there any other tradeoffs that I don't know about?
ios frameworks xcode swift carthage
Paul cantrell
source share