I have a xcworkspace built with cocoapods (pod install). The things it that I can't figure out how xCode knows that when I build MyProject it must also build the Pods project?
Hypothesis:
In MyProject main target in build phase "Link Binary with Libraries" section I can see "Pods_MyProject.framework" which refers to the .framework build by Pods ( the project ) Pods-MyProject target (is it correct?). This target has in his "Target Dependencies" all the pods.
But I still don't understand two things
Here is the build phases tab of "MyProject" (its real name is "clicktube"):

The Pods-MyProject "Link with Libraries" section:

Here is the interesting thing:
https://developer.apple.com/library/content/featuredarticles/XcodeConcepts/Concept-Workspace.html#//apple_ref/doc/uid/TP40009328-CH7-SW1
Xcode examines the files in the build directory to discover implicit dependencies. For example, if one project included in a workspace builds a library that is linked against by another project in the same workspace, Xcode automatically builds the library before building the other project, even if the build configuration does not make this dependency explicit. You can override such implicit dependencies with explicit build settings if necessary. For explicit dependencies, you must create project references.
There are two types of dependencies: explicit and implicit. You specify the explicit ones in the "Target dependencies". The implicit dependencies are discovered by XCode by looking at the "Link binary with libraries" and then it decides the order in which the projects will be built.
How the "Pods_MyProject.framework" contains all the pods while its "Link Binary with Libraries" section is almost empty ?
If you look into the Pods.xcodeproj there is a target for each framework that you 'installed' via podfile. Then there is the Pods_MyProject.framework target which has an explicit dependency on all these frameworks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With