PCH can be used to store shared information, such as the width and height of a device's screen. Version number and so on common information
The old version of Xcode automatically creates a PCH file for us, and the new version is not created automatically, if you need to create it yourself manually
Constants can be defined inside after creation is complete
Here is an example of screen size
As follows
------------------------Split Line------------------------split line------------------------split line------------------------Split Line------------- -----------Split Line------------------------Split Line------------------------
The code is as follows:
Get screen width, height
#define SCREEN_FRAME ([UIScreen mainscreen].applicationframe)
#define SCREEN_WIDTH ([UIScreen mainscreen].bounds.size.width)
#define Screen_height ([UIScreen mainscreen].bounds.size.height)
Finally need to make a configuration
Then you can use it directly in your program.
CGRectMake (0,60,screen_width, screen_height-60)
Create a PCH file