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.1K+ Learners
    4.3  (288)
    Angular7 for Advanced Level
    3 hrs
    Advanced
    11.1K+ Learners
    4.58  (341)
    Visual Studio Online
    1 hrs
    Beginner
    14.7K+ Learners
    4.43  (568)
    Software Testing Tutorial
    1 hrs
    Beginner
    142.7K+ Learners
    4.51  (11955)
    Programming Basics
    1 hrs
    Beginner
    191.8K+ Learners
    4.46  (12574)
    Coding Environment
    1 hrs
    Beginner
    21.4K+ Learners
    4.34  (457)
    JQuery Tutorial
    1 hrs
    Beginner
    12.3K+ Learners
    4.41  (722)
    What is IoT?
    1 hrs
    Beginner
    33.8K+ Learners
    4.46  (2983)