2016-08-12 31 views
0

代碼中有一種方法來獲取正在使用的.xcconfig文件的名稱?從代碼獲取xcconfig配置文件名

正如下面的圖片中,我想能夠找出配置是「實驗2」

enter image description here

+0

我結束了以下解決方案:http://stackoverflow.com/a/32540064/4577878 – pflous

回答

1

這是閱讀的一種方式......

編輯您的實驗2 .xcconfig文件,加入

OTHER_SWIFT_FLAGS = -DLAB2 

,然後你的代碼中

#if LAB2 
     print("Build using lab2.xcconfig") 
    #else 
     print("Build using some_other.xcconfig") 
    #endif 
相關問題