iOS swift configurations

Manage Configurations 2

Hello from the other side! If you have not read the first story, Manage Configurations 1.

As we remember, we separated schemes as debug, test and release. We did set the app name by the scheme. What can we do more?

What About Bundle ID?

Sometimes, we need to separate the app because we would like to watch analytics by released or tested apps. Dividing the app helps us to diagnose what we are looking for.

Run the app with three different schemes and you see 3 different apps.


App Icon, Your Turn!

We have created 3 different app icons. Let’s see how to add them to the project.

Open Assets.xcassets and tap App Icons & Launch Images / New iOS App Icon. Add 2 image sets which are named AppIcon-debug and AppIcon-test.

Go to the Build Settings and search with “asset catalog app icon set name”. Give names AppIcon-debug for DEBUG and AppIcon-test for TEST.

Build the app via every scheme and we see different app icons.


Base URL

Compilation Conditions: A conditional compilation block allows code to be conditionally compiled depending on the value of one or more compilation conditions.

We need to create 3 conditions for schemes. Go to the Build Settings and search with “active compilation conditions”. Set name DEBUG for Debug, RELEASE for Release, TEST for Test.

Go to the view(or controller if you are not using SwiftUI) which launch at the beginning. Use the if-else syntax of compilation condition to manage base URL.

When we run the app via Release scheme, we see that


Full project

Read in Medium

Keep following for more!

Note: Please comment if any correction or better way exists then you can help everyone.

Leave a Reply:

Your email address will not be published.