forkingdog / forkingdog/UITableView-FDTemplateLayoutCell
一些开发上的实际问题
- Dominant language
- Objective-C
- Stars
- 9.9k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
今天看了源码,有几个问题请教:key缓存的方式与一般的model直接赋值,实现了解耦。但也使的cell赋值大于一次(高度缓存没有命中),对一些统计逻辑需要另做处理
```
// Manually calls to ensure consistent behavior with actual cells. (that are displayed on screen)
[templateLayoutCell prepareForReuse];
// Customize and provide content for our template cell.
if (configuration) {
configuration(templateLayoutCell);
}
```
* key方式的缓存清除
需要程序员定期的删除高度缓存`invalidateAllHeightCache`,不像indexpath一样通过hook可以自动的实现高度缓存的清除。不然key方式的高度缓存一直在字典里面累加(当然这个,程序员可以通过key值解决)
* 对原生UITableView使用hook
UITableView (FDIndexPathHeightCacheInvalidation)里面的钩子函数,保证了indexpath刷新时能够更新高度缓存,但是项目里面其他的UITableView实现没有用本框架(比如一些简单的tableview),也被迫调用钩子函数。是否可以通过一个开关,或者在UITableView的子类里面实现这些钩子函数,从而不至于影响全局
**源码没有使用runloop空闲来预缓存,还是有点遗憾的:)。不过iOS8之后,好像也没有预缓存的必要了**
---
> 写完之后感觉我是不是要求的太多,哈哈,感谢感谢!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.