如何在使用AsyncDisplayKit时添加节头/页脚视图?

xi.*_*lin 1 uitableview sectionheader ios asyncdisplaykit

如此看来,目前ASTableNode且ASTableView都缺乏的部分页眉/页脚视图支持.

我不仅可以找到一个协议方法:

- (nullable NSString *)tableNode:(ASTableNode *)tableNode titleForHeaderInSection:(NSInteger)section
Run Code Online (Sandbox Code Playgroud)

什么都没有.

委托/ dataSource setter方法已被AsyncDisplayKit拦截,因此我无法使用UIKit的方式来执行此操作.

我在使用AsyncDisplayKit时可以添加节头/页脚视图吗?

xi.*_*lin 5

只是找出ASTableNode会调用UITableViewDelegate方法.

所以只需实现这些方法

- (nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section;

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section;
Run Code Online (Sandbox Code Playgroud)

它会像以前一样工作.