Managing dependencies in static libraries with cocoapods Managing dependencies in static libraries with cocoapods xcode xcode

Managing dependencies in static libraries with cocoapods


CocoaPods works well for people using pods. It is much harder to use it when you develop pods, or worse, when you develop an app along with (a) librar(y)ies which are all pods… (which may depend also on pods).

What you must know is that CocoaPods is here to resolve the dependencies. Your problem seems to me that you totally bypass that feature by having your pods in dev already in your workspace! Of course, if you do a “pod install” inside your project directory, you’ll get just a mess of dependencies, between what Pod will install according to the Podfile, and your own pod codebases right in the same folder tree.

What I do is to develop pods (which may or not depends on other pods) separatedly. It is also good practice to not be in the same “workspace” of an app. And you can develop your pod with a demo app.

And in the directory of the main app, I indicate the “develop” branch of my own pods, in the Podfile. Hence, the app is being developed with depdencies on pods, as if these pods were published officially. Except that they are simply in dev as well.

It forces you of course to have things separatedly, which is not so nice when you need to change someting in the code of a pod for your app.

Two possibilities (none of them really nice). First, change your pod, then make a “pod update” inside your app folder.

Second, play with the pod code right into the app workspace (the pod code has been imported by the pod update command). And once satisfied, back port the modifications to the original pod code for commit.

Lots of back and forth, but I haven’t found better than that.