In my projet MyProject
(I'm using cocoapods
), I want to use MyPod
.
The classes of MyPod
are copied to MyProject
, but not the .pch
. Hence, the project is not compiling.
So, I have two questions :
.pch
of MyPod
to the imported classes of MyPod
?.pch
of MyPod
in the .pch
of MyProject
(or, to "modify" the latter)I am sure 1. is possible. I am learning cocoapods
right now.
EDIT
As said in the documentation of cocoapods, the prefix_header_contents
attribute of a .podspec
is "not recommended as Pods should not pollute the prefix header of other libraries or of the user project."
So, is there any other way? Are we supposed to develop libraries without anything in the .pch
?
One of the main purposes of subspecs is to enable configuration of a single framework. If you want separate frameworks, you should use a separate podspec for each one.
You have to use the following property:
s.prefix_header_contents
For instance: s.prefix_header_contents = '#import "SomeClass.h"'
.
It will add this line of code to the pch
file associated to the Pod.
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