iOS

Creating xcconfig files

Creating xcconfig files

Let's construct the xcconfig files that your Configurations will use now that we've established a basic project structure. Create a new file in the Config folder and name it Configuration Settings File.

You wouldn't want these in the application bundle because they aren't being compiled, so name the file Development and make sure no Target is selected.

For Staging and Production, repeat the processes above.

Setting xcconfig files for Configurations

You have to select the proper file for each Configuration you created previously now that you have your xcconfig files set up.

In the Editor window, return to the Project Info tab. When you click the disclosure indication for a particular configuration, you'll see that the target has no configuration. Select the relevant configuration file from the menu on the right. Continue until all of the Configurations are set to the following:

Accessing configuration values from project settings

To use your new configuration settings for your project, let’s begin with editing the Info.plist

Remember that each environment will have its own APP_NAME and APP_BUNDLE_ID.

For the proper keys, you may use variable substitution in the .plist, substituting your custom variables from the xcconfig files. The value of the Bundle name has been changed to $(APP_NAME), and Bundle Identifier has been changed to $(APP_BUNDLE_ID).

Build and run the program using different scenarios from the Scheme selector after making these changes. As a result, there are three different versions of the program.

Top course recommendations for you

    Introduction to Kubernetes
    2 hrs
    Beginner
    8.4K+ Learners
    4.29  (299)
    Angular7 for Advanced Level
    3 hrs
    Advanced
    11.4K+ Learners
    4.59  (386)
    Visual Studio Online
    1 hrs
    Beginner
    15K+ Learners
    4.44  (590)
    Software Testing Tutorial
    1 hrs
    Beginner
    145.7K+ Learners
    4.51  (12991)
    Programming Basics
    1 hrs
    Beginner
    195.3K+ Learners
    4.46  (13595)
    Coding Environment
    1 hrs
    Beginner
    21.7K+ Learners
    4.31  (496)
    JQuery Tutorial
    1 hrs
    Beginner
    12.4K+ Learners
    4.42  (769)
    What is IoT?
    1 hrs
    Beginner
    34.7K+ Learners
    4.47  (3422)