iOS 预编译指令
文章目录
iOS 预编译指令
是否是模拟器
#if targetEnvironment(simulator)
print("模拟器")
#else
print("真机")
#endif是否是DEBUG模式
#if DEBUG
print("DEBUG")
#else
print("其他")
#endif#if targetEnvironment(simulator)
print("模拟器")
#else
print("真机")
#endif#if DEBUG
print("DEBUG")
#else
print("其他")
#endif
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论