#ifdef replacement in the Swift language

前端 未结 17 1863
名媛妹妹
名媛妹妹 2020-11-22 10:35

In C/C++/Objective C you can define a macro using compiler preprocessors. Moreover, you can include/exclude some parts of code using compiler preprocessors.

         


        
17条回答
  •  青春惊慌失措
    2020-11-22 11:30

    ![In Xcode 8 & above go to build setting -> search for custom flags ]1

    In code

     #if Live
        print("Live")
        #else
        print("debug")
        #endif
    

提交回复
热议问题