Is there an equivalent iOS development concept for an Android product?

We use product tastes in Android to keep the same code under source control, but conditionally target endpoints on dev / qa / production servers based on the taste chosen. For reference:

http://tools.android.com/tech-docs/new-build-system/build-system-concepts

For example, when we want to test a new endpoint in a "dev" environment, we may have a file in src/dev/res/values/endpoints.xml that has an XML equivalent entry urlbase = https://dev-endpoint.ourserver.com/v3/ , and building using the product "dev" flavor to create an APK pointed to our development environment.

Is there an equivalent concept for iOS development?

+5
source share
1 answer

Yes. If you select your project in the left pane, then select the project under the project in the inner left pane and select “Information” in the upper upper pane, you will see the “Configurations” section. Here you can configure.

Then select the target in the inner left pane and select "Configure Options" in the inner top pane. Find "preproc" in the search box. In the Apple LLVM - Preprocessing section, you can add your own preprocessor macros. For your configurations, define something like "DEV = 1", etc.

Now in your code you can say #if DEV , etc.

Many projects use AFNetworking to talk to their rear end. You can set baseURL for your subclass AFHTTPSessionManager or something else, based on the definitions.

+11
source

All Articles