是否可以创建编译时警告或错误xcode



是否可以在xcode中创建自己的错误和警告?

我有一个情况,如果任何其他开发人员使用特定的函数,我需要通知用户他应该用特定的条件包装该函数。

例如,如果其他开发人员使用视图控制器的当前功能,那么他应该使用if块包装该功能,以便在移动到下一个屏幕之前检查某些条件

if enableUserToMove
{
self.present(vc, animated: true)
}
#warning("Needs to be refactored")
// some dodgy code here

#if !canImport(UIKit)
#error("This framework requires UIKit!")
#endif

最新更新