Warn on calls to UIKit from background threads

前端 未结 3 1496
[愿得一人]
[愿得一人] 2021-01-02 09:58

iOS\'s UIKit is not thread-safe, let us call this fact well known. I know the rule, I\'m careful, but I still get bitten - and every now and then the resulting crash is far

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-02 10:18

    This code (just add to project and compile this file without ARC) causes assertions on UIKit access outside of the main thread: https://gist.github.com/steipete/5664345

    I've just used it to pickup numerous UIKit/main thread issues in some code I've just picked up.

提交回复
热议问题