mirror of
https://github.com/HackPlan/AsyncDisplayKit.git
synced 2026-03-29 16:48:59 +08:00
Enable node detection for tableHeaderView and tableFooterView on ASTableView.
Ensure they behave as managed nodes - which prevents them from clearContents-ing their subnodes when the table reloads, as they will be onscreen as long as the table is.
This commit is contained in:
@@ -532,6 +532,22 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
#pragma mark -
|
||||
#pragma mark Intercepted selectors
|
||||
|
||||
- (void)setTableHeaderView:(UIView *)tableHeaderView
|
||||
{
|
||||
// Typically the view will be nil before setting it, but reset state if it is being re-hosted.
|
||||
[self.tableHeaderView.asyncdisplaykit_node exitHierarchyState:ASHierarchyStateRangeManaged];
|
||||
[super setTableHeaderView:tableHeaderView];
|
||||
[self.tableHeaderView.asyncdisplaykit_node enterHierarchyState:ASHierarchyStateRangeManaged];
|
||||
}
|
||||
|
||||
- (void)setTableFooterView:(UIView *)tableFooterView
|
||||
{
|
||||
// Typically the view will be nil before setting it, but reset state if it is being re-hosted.
|
||||
[self.tableFooterView.asyncdisplaykit_node exitHierarchyState:ASHierarchyStateRangeManaged];
|
||||
[super setTableFooterView:tableFooterView];
|
||||
[self.tableFooterView.asyncdisplaykit_node enterHierarchyState:ASHierarchyStateRangeManaged];
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
_ASTableViewCell *cell = [self dequeueReusableCellWithIdentifier:kCellReuseIdentifier forIndexPath:indexPath];
|
||||
|
||||
Reference in New Issue
Block a user