Why precompiled header dropped in recent Xcode versions?

I remember new proejct template generated by earlier versions of Xcode had explicit PCH support. But recent versions dropped this feature. It seems Xcode has an implicit PCH cache. I do not know how this cache works.


I actually want the old explicit way of creating PCH. For example, I want to include <CloudKit/CloudKit> in PCH so that it is available to all files in a project. Is there any way to accomplish this using the new implicit cache?

Accepted Reply

Precompiled Header Files are discouraged in favor of modules. You can still configure your project to use a PCH file if you prefer. Create a header file with the .PCH extension and edit the Prefix Header [GCC_PREFIX_HEADER] build setting for your target to be the path to the file you jsut created, relative to your project.

Replies

Precompiled Header Files are discouraged in favor of modules. You can still configure your project to use a PCH file if you prefer. Create a header file with the .PCH extension and edit the Prefix Header [GCC_PREFIX_HEADER] build setting for your target to be the path to the file you jsut created, relative to your project.

Thanks Justin. I never knew Xcode has evolved so much.


But I don't know what is a module. Can you please provide some useful links on this topic. Thanks.