PCH can be used to store shared information, such as the width and height of a device's screen. Version and so on common information
The old version of Xcode will create the PCH file for us on its own initiative, and the new version number is not created on its own initiative. Suppose you need to use the ability to manually create
Can define constants in the inside after creation
Here is an example of screen size
For example, the following
------------------------Cutting line------------------------cutting line------------------------cutting line------------------------cutting line------------- -----------Cutting line------------------------cutting 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 do a configuration
And then use it in the program to directly use the
CGRectMake (0,screen_width, screen_height- )
How to use the. pch file in iOS