在myProject.pch文件中定义自己的宏,使用C宏
例如:
#define Enable_Analytics
,我想附上内
#ifdef Enable_Analytics
// Code statements which has to executed only if Enable_Analytics is defined
#endif
在多个地方的代码几条语句
这对包含/删除基于宏的代码很有用。 在Objective-C这个工程,但在迅速,我得到错误。如何在swift中使用#ifdef?
你有看看[#ifdef替换在Swift语言](http://stackoverflow.com/questions/24003291/ifdef-replacement-in-the-swift-language)? –
@MartinR,是的,我看过那个。我不想移动它来构建设置,因为我的项目中有很多宏。如果没有其他解决方案,我会考虑一下。 – Kishoretheju