I am new to Xcode.
I spent the last two days trying to figure out how to test my application on my iPhone, which accesses the web service. On the simulator, I can use the hard-coded variable "localhost", but I don't want to hard-code all the configuration parameters.
I use Swift + Xcode 6, but I think this is the same process as Xcode 5.
I have looked through a lot of articles and I think I should use .xcconfig, but this is very obscure.
For example, I created an Environment.xcconfig
file. I filled it
API_BASE_URL = "http://localhost:4000/api/v1"
Then I went to Project -> Info and installed the Debug configuration file on Environment
.
Then I tried to access the variable in the code through ${API_BASE_URL}
, but I got Use of unresolved identifier 'API_BASE_URL'
.
This is extremely frustrating. Any ideas?
source share