How can I include a .pch for a specific pod, in cocoapods?

cocoapods

Solution

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.

Problem

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 : - How can I add the `.pch` of `MyPod` to the imported classes of `MyPod`? - Is there a way to "include" the `.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`?

Original source