feat: refine

This commit is contained in:
LiuBinPeng
2022-05-30 15:02:31 +08:00
parent 538801e651
commit 6cd0cf5144
60 changed files with 135 additions and 1487 deletions

View File

@@ -33,7 +33,7 @@
![](https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/assets/RunLoop-SourceCode.png)
![](./../assets/RunLoop-SourceCode.png)
## RunLoop API
@@ -392,7 +392,7 @@ CFRelease(obersver);
但是如何直到系统是运行 RunLoop 的哪个函数?给 viewDidLoad 设置断点,在 lldb 模式输入 `bt` 查看堆栈
![](https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/assets/RunLoop-Specific.png)
![](./../assets/RunLoop-Specific.png)
查看 CF 中 `CFRunLoop.c`源码。方法比较复杂,做了精简摘要
@@ -1501,7 +1501,7 @@ UITableView 在滚动的时候一个优化点之一就是 UIImageView 的显示
2. `[[NSRunLoop currentRunLoop] run]` api 换掉。查看系统说明,底层其实就是一个无限循环,循环内部不断调用 `runMode:beforeDate:`。下面也有建议,建议我们想销毁 RunLoop可以替换 API比如设置一个变量标记是否需要结束 RunLoop
![](https://raw.githubusercontent.com/FantasticLBP/knowledge-kit/assets/RunLoop-RunIssue.png)
![](./../assets/RunLoop-RunIssue.png)
改进代码如下