Skip to content

Unobtrusive runtime warnings for libraries #3145

@kemchenj

Description

@kemchenj

推荐收录

链接

https://www.pointfree.co/blog/posts/70-unobtrusive-runtime-warnings-for-libraries

理由

写代码的过程中,API 调用的一部分错误是无法通过类型检查处理的,但直接 fatalError 也不好,在业务层使用 #if DEBUG 进行检查也很容易错漏。

Point-Free 就在这篇文章里就为我们介绍了更好的处理方式,例如通过代码进入断点,亦或者是通过 Xcode 抛出 Runtime Warning,给上层用户更好的提示,并且将这些逻辑封装起来。

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions