[ASCellNode] Upgrades to ASCellNodeVisibilityEvent to ensure it is always synchronized with visibilityDidChange:

This commit is contained in:
Scott Goodson
2016-03-10 20:21:00 -08:00
parent c2b0670132
commit ff8ffffb7b
5 changed files with 47 additions and 31 deletions

View File

@@ -188,6 +188,20 @@
// To be overriden by subclasses
}
- (void)visibilityDidChange:(BOOL)isVisible
{
[super visibilityDidChange:isVisible];
CGRect cellFrame = CGRectZero;
if (_scrollView) {
// It is not safe to message nil with a structure return value, so ensure our _scrollView has not died.
cellFrame = [self.view convertRect:self.bounds toView:_scrollView];
}
[self cellNodeVisibilityEvent:isVisible ? ASCellNodeVisibilityEventVisible : ASCellNodeVisibilityEventInvisible
inScrollView:_scrollView
withCellFrame:cellFrame];
}
@end