File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121- (instancetype )initWithNode : (ASDisplayNode *)node ;
2222
23+ /* *
24+ * The constrained size used to measure the backing node.
25+ *
26+ * @discussion Defaults to providing a size range that uses the view controller view's bounds as
27+ * both the min and max definitions. Override this method to provide a custom size range to the
28+ * backing node.
29+ */
30+ - (ASSizeRange)nodeConstrainedSize ;
31+
2332@end
Original file line number Diff line number Diff line change @@ -40,9 +40,7 @@ - (void)loadView
4040- (void )viewWillLayoutSubviews
4141{
4242 [super viewWillLayoutSubviews ];
43- CGSize viewSize = self.view .bounds .size ;
44- ASSizeRange constrainedSize = ASSizeRangeMake (viewSize, viewSize);
45- [_node measureWithSizeRange: constrainedSize];
43+ [_node measureWithSizeRange: [self nodeConstrainedSize ]];
4644}
4745
4846- (void )viewDidLayoutSubviews
@@ -61,4 +59,12 @@ - (void)viewWillAppear:(BOOL)animated
6159 [_node recursivelyFetchData ];
6260}
6361
62+ // MARK: - Layout Helpers
63+
64+ - (ASSizeRange)nodeConstrainedSize
65+ {
66+ CGSize viewSize = self.view .bounds .size ;
67+ return ASSizeRangeMake (viewSize, viewSize);
68+ }
69+
6470@end
You can’t perform that action at this time.
0 commit comments