0

Is there a way in code to get the name of the .xcconfig file being used?

As in the picture below I would like to be able to find out the configuration is "Lab2"

enter image description here

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
pflous
  • 573
  • 6
  • 17

1 Answers1

1

This is one way to read it...

Edit your Lab2.xcconfig file and add this

OTHER_SWIFT_FLAGS = -DLAB2

and then inside your code

    #if LAB2
        print("Build using lab2.xcconfig")
    #else
        print("Build using some_other.xcconfig")
    #endif
chuthan20
  • 5,389
  • 1
  • 17
  • 21