What it is ?
Prefix.pch is a precompiled header. Precompiled headers were invented to make compiling faster. Rather than parsing the same header files over and over, these files get parsed once, ahead of time.
Pre-compiled header files, or PCH files, attempt to address this problem by providing a mechanism for pre-computing and caching much of the work required during the pre-processing phase of compilation.
Xcode
In Xcode, you need to follow two steps :
- Provide the full path to the “Prefix Header” in “Build Settings” ==> “Apple LLVM Language Section”
- See the below image, in which i have put the “GoogleAuthentication.pch” file path to “Prefix Header”
- My file is in the Root of the project. So i have added “GoogleAuthentication.pch”.
If we have put “GoogleAuthentication.pch” to Any folder named like “Sample” then we have added “Sample/GoogleAuthentication.pch”
- Enabling Precompile Prefix Header.
so they get precompiled. But the idea behind a prefix header is different from precompiling.

A prefix header is implicitly included at the start of every source file. It’s like each source file adds
#import “Prefix.pch”
Email me when Jigar M publishes or recommends stories