0

How can I load URL string value from .xcconfig file in code? I have custom string property in it:

BASE_URL = "https://test.custom.com/api/4.0/"

I need to load this URL in code, so I added in Info.plist file this:

<key>TSBaseURL</key>
<string>$(BASE_URL)</string>

But when I tried to load this value from code, I get only trimmed value, because Xcode thinks, that // characters means commentary:

let baseURL = NSBundle.mainBundle().infoDictionary?["TSBaseURL"] as? String

returns

https:

I found this technical note from Apple, but I can't solve my problem with it. So exists any solution, how to load URL string from .xcconfig file?

Deny
  • 1,441
  • 1
  • 13
  • 26
  • 1
    This question is maybe duplicated, but original question is not answered, so why not to ask again and start up some discussion ... – Deny May 02 '15 at 21:47
  • It is the same question (unless I am mistaken) and the original has 4 answers. Did you try them? If they don't work then you can leave a comment and ask for clarification. And if someone finds a better solution then it should be added to the original. – Martin R May 02 '15 at 21:52

0 Answers0