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
    6.8K+ Learners
    4.29  (252)
    Angular7 for Advanced Level
    3 hrs
    Advanced
    9.6K+ Learners
    4.62  (229)
    Java Algorithms
    2 hrs
    Intermediate
    19.1K+ Learners
    4.49  (419)
    Visual Studio Online
    1 hrs
    Beginner
    13K+ Learners
    4.4  (463)
    Software Testing Tutorial
    1 hrs
    Beginner
    122.6K+ Learners
    4.49  (8290)
    Sorting Algorithms in C
    3 hrs
    Beginner
    11.5K+ Learners
    4.49  (195)
    Programming Basics
    1 hrs
    Beginner
    167.1K+ Learners
    4.48  (8436)
    Coding Environment
    1 hrs
    Beginner
    18.7K+ Learners
    4.41  (360)
    JQuery Tutorial
    1 hrs
    Beginner
    10.9K+ Learners
    4.41  (543)
    What is IoT?
    1 hrs
    Beginner
    29.6K+ Learners
    4.46  (2189)