PCH file, pch File
1. Introduction
The PCH file is a global reference shared file in Xcode programming. The header file or macro definition can be introduced here to facilitate access to multiple files in the program.
2. Create a PCH File
Open Project New File... -> IOS Other-> PCH File: Enter the PCH File name.
3. PCH file configuration
A. Find the Project> Build Settings and search for "Prefix Header".
B. Project name/PrefixHeader. pch (for example, weihuan/PrefixHeader. pch );
C. Change the Precompile Prefix Header to YES. The pre-compiled pch file will be cached to increase the compilation speed;
NOTE: If TARGETS is not selected as FastRenterTests, you should select FastRenter. Otherwise, the imported class file cannot be found.
4. Commonly Used PCH files
① Import the header file;
② Write common macros;
③ Define common constants;
5. Custom file name prefix settings when creating a file