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.5K+ Learners
    4.29  (303)
    Angular7 for Advanced Level
    3 hrs
    Advanced
    11.5K+ Learners
    4.6  (401)
    Visual Studio Online
    1 hrs
    Beginner
    15.1K+ Learners
    4.44  (602)
    Software Testing Tutorial
    1 hrs
    Beginner
    146.9K+ Learners
    4.51  (13156)
    Programming Basics
    1 hrs
    Beginner
    196.7K+ Learners
    4.46  (13784)
    Coding Environment
    1 hrs
    Beginner
    21.9K+ Learners
    4.32  (513)
    JQuery Tutorial
    1 hrs
    Beginner
    12.5K+ Learners
    4.42  (777)
    What is IoT?
    1 hrs
    Beginner
    35.2K+ Learners
    4.47  (3522)