5

I added a user defined settings in project build settings:

enter image description here

enter image description here

How can I access the value of my_name in my iOS project swift code?

Leem.fin
  • 40,781
  • 83
  • 202
  • 354
  • Possibly Related: https://stackoverflow.com/questions/3968919/how-can-i-access-a-user-defined-xcode-build-setting – Ahmad F Apr 16 '18 at 11:45

1 Answers1

0

You are misunderstanding the User Defined setting.

If you ant to provide specific value by environment you just use :

  • for Swift :

    Other Swift Flag : -D my_value

  • For Objc :

    preprocessor macro : my_value=1

Then in your code you can do

#if my_value
    some code here
#endif
CZ54
  • 5,488
  • 1
  • 24
  • 39