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.3K+ Learners
    4.3  (294)
    Angular7 for Advanced Level
    3 hrs
    Advanced
    11.2K+ Learners
    4.59  (350)
    Visual Studio Online
    1 hrs
    Beginner
    14.9K+ Learners
    4.44  (580)
    Software Testing Tutorial
    1 hrs
    Beginner
    144.2K+ Learners
    4.51  (12423)
    Programming Basics
    1 hrs
    Beginner
    193.5K+ Learners
    4.46  (13022)
    Coding Environment
    1 hrs
    Beginner
    21.5K+ Learners
    4.31  (474)
    JQuery Tutorial
    1 hrs
    Beginner
    12.3K+ Learners
    4.42  (740)
    What is IoT?
    1 hrs
    Beginner
    34.2K+ Learners
    4.46  (3163)