This repository was archived by the owner on Feb 2, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99//
1010
1111#import " ASScrollNode.h"
12+ #import " ASDisplayNodeExtras.h"
13+ #import " ASDisplayNode+FrameworkPrivate.h"
1214#import " ASDisplayNode+FrameworkSubclasses.h"
1315#import " ASLayout.h"
1416#import " _ASDisplayLayer.h"
@@ -24,6 +26,32 @@ + (Class)layerClass
2426 return [_ASDisplayLayer class ];
2527}
2628
29+ - (ASScrollNode *)scrollNode
30+ {
31+ return (ASScrollNode *)ASViewToDisplayNode (self);
32+ }
33+
34+ #pragma mark - _ASDisplayView behavior substitutions
35+ // Need these to drive interfaceState so we know when we are visible, if not nested in another range-managing element.
36+ // Because our superclass is a true UIKit class, we cannot also subclass _ASDisplayView.
37+ - (void )willMoveToWindow : (UIWindow *)newWindow
38+ {
39+ ASDisplayNode *node = self.scrollNode ; // Create strong reference to weak ivar.
40+ BOOL visible = (newWindow != nil );
41+ if (visible && !node.inHierarchy ) {
42+ [node __enterHierarchy ];
43+ }
44+ }
45+
46+ - (void )didMoveToWindow
47+ {
48+ ASDisplayNode *node = self.scrollNode ; // Create strong reference to weak ivar.
49+ BOOL visible = (self.window != nil );
50+ if (!visible && node.inHierarchy ) {
51+ [node __exitHierarchy ];
52+ }
53+ }
54+
2755@end
2856
2957@implementation ASScrollNode
You can’t perform that action at this time.
0 commit comments