I wanted to define few custom values in a pre-compiled header for different targets of my app. I tried the following to define headers, but none worked:
- by adding a header from
Editor -> Add Build Setting -> Add User Defined settingand assign key value pair. - Set
Preprocess info.plistfile to YES inBuild Settingsand set the header (.h) file inInfo.plist Preprocessor Prefix file.
How do I add and set a pch key so that I can set true for UAT target and false for Production target using #if ?




If you are using swift. Then you can add custom swift flags. Under Build Settings -> Swift Compiler - Custom Flags.
and then in code use