Woomin Josh Park Woomin Josh Park - 5 months ago 36
iOS Question

Using submodule when developing a Cocoapods library

I'm building a Cocoapods library and I have another pod library that I'm using with it.

In the

podfile
I'm adding
:submodules => true
and the funny thing is, it works sometimes.

The other day, Xcode was driving me crazy because at one point it stopped working, and I kept on cleaning and removing derived data. Same thing for 30 minutes while looking up on the internet, and suddenly it started working again.

What is going on? Is this one of Xcode's bugs? How can I resolve this?

If this is not the way to do it, how do I use an external pods library for developing another library?

Answer

Updating the podspec file solved my problems.

So, if you want to use a dependency for your development pods,

In the .podspec file:

s.dependency 'MyDependency'

In the podfile:

target 'MyApp_Example' do
  pod 'MyDependency', :submodules => true
  pod 'MyApp', :path => '../'
end