xcode - Is there an equivalent concept in iOS development to an Android product flavor? -


we utilize product flavors in android keep same code under source control, conditionally target endpoints dev/qa/production servers based on flavor selected. reference:

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

for example, when want test new endpoint in "dev" environment can have file in src/dev/res/values/endpoints.xml has entry that's xml equivalent of urlbase = https://dev-endpoint.ourserver.com/v3/, , build using "dev" product flavor build apk pointed our dev environment.

is there equivalent concept ios development?

yes. if select project in left bar, select project under project in inner left bar, , select info on inner top bar, see section labeled configurations. can configurations here.

then select target on inner left bar , select build settings on inner top bar. search "preproc" in search box. under apple llvm - preprocessing section, can add custom preprocessor macros. configurations, define "dev=1", etc.

now in code can #if dev, etc.

many projects use afnetworking talk end. can set baseurl afhttpsessionmanager subclass, or whatever, based on defines.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -