Hi @SketchK_琦爷

Thanks for reading! I'm so glad I was able to help.

To answer your question I can share the things I would be doing. However it is important to note I have not distributing compiled static libraries through Cocoapods. I assume you want to distribute your code compiled given the article and your question.

First I would advise you to create a static framework instead of static library. I have an article on how to do that.


This is important as static libraries (.a) will not work for devices and simulators at the same time. A static framework will. It is pretty much the same framework support multiple binaries.

Looking at the Cocoapods specs the following might be of interest:

1. https://guides.cocoapods.org/syntax/podspec.html#user_target_xcconfig

You can use user_target_xcconfig to add .swiftmodule directory path to the search paths of the integrator. I have covered the need of search path configuration on my medium post shared above.

2. https://guides.cocoapods.org/syntax/podspec.html#static_framework

I am unsure just by reading the podspec as to what this does completely. But the name sure seems to tick the box of interesting 😅.

Thanks for asking this question. This sparks another blog post idea!

I hope my answer was of help.

Senior iOS Engineer @ Onfido. Writing weekly blogs on iOS and programming. Follow me to stay tuned!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store