iOS 预编译指令

iOS 预编译指令

是否是模拟器

#if targetEnvironment(simulator)
    print("模拟器")
#else
    print("真机")
#endif

是否是DEBUG模式

#if DEBUG
    print("DEBUG")
#else
    print("其他")
#endif

评论

暂无评论