|
19 | 19 | #pragma mark ASCellNode |
20 | 20 |
|
21 | 21 | @interface ASCellNode (){ |
22 | | -ASDisplayNodeDidLoadBlock _nodeLoadedBlock; |
23 | | -ASDisplayNode *_viewControllerNode; |
24 | | -UIViewController *_viewController; |
| 22 | + ASDisplayNodeDidLoadBlock _nodeLoadedBlock; |
| 23 | + ASDisplayNode *_viewControllerNode; |
| 24 | + UIViewController *_viewController; |
25 | 25 | } |
| 26 | + |
26 | 27 | @end |
27 | 28 |
|
28 | 29 | @implementation ASCellNode |
@@ -53,24 +54,18 @@ - (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)vi |
53 | 54 |
|
54 | 55 | _viewController = viewControllerBlock(); |
55 | 56 |
|
56 | | - NSLog(@"%d", _viewController.view.gestureRecognizers.count); |
57 | | -// for (UIGestureRecognizer *recognizer in [_viewController.view gestureRecognizers]) { |
58 | | -// |
59 | | -// } |
60 | | - |
61 | 57 | _viewControllerNode = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{ |
62 | 58 | return _viewController.view; |
63 | 59 | } didLoadBlock:didLoadBlock]; |
64 | 60 |
|
65 | 61 | [self addSubnode:_viewControllerNode]; |
66 | 62 |
|
67 | | - _nodeLoadedBlock = didLoadBlock; //not sure where i should plug in to call this... |
| 63 | + _nodeLoadedBlock = didLoadBlock; |
68 | 64 | return self; |
69 | 65 | } |
70 | 66 |
|
71 | 67 | - (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize { |
72 | 68 | _viewControllerNode.frame = (CGRect){{0,0}, constrainedSize.max}; |
73 | | - |
74 | 69 | return [super layoutSpecThatFits:constrainedSize]; |
75 | 70 | } |
76 | 71 |
|
@@ -111,39 +106,27 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event |
111 | 106 | ASDisplayNodeAssertMainThread(); |
112 | 107 | ASDisplayNodeAssert([self.view isKindOfClass:_ASDisplayView.class], @"ASCellNode views must be of type _ASDisplayView"); |
113 | 108 | [(_ASDisplayView *)self.view __forwardTouchesBegan:touches withEvent:event]; |
114 | | -// if (_viewController) { |
115 | | -// [_viewController touchesBegan:touches withEvent:event]; |
116 | | -// } |
117 | 109 | } |
118 | 110 |
|
119 | 111 | - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event |
120 | 112 | { |
121 | 113 | ASDisplayNodeAssertMainThread(); |
122 | 114 | ASDisplayNodeAssert([self.view isKindOfClass:_ASDisplayView.class], @"ASCellNode views must be of type _ASDisplayView"); |
123 | 115 | [(_ASDisplayView *)self.view __forwardTouchesMoved:touches withEvent:event]; |
124 | | -// if (_viewController) { |
125 | | -// [_viewController touchesMoved:touches withEvent:event]; |
126 | | -// } |
127 | 116 | } |
128 | 117 |
|
129 | 118 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event |
130 | 119 | { |
131 | 120 | ASDisplayNodeAssertMainThread(); |
132 | 121 | ASDisplayNodeAssert([self.view isKindOfClass:_ASDisplayView.class], @"ASCellNode views must be of type _ASDisplayView"); |
133 | 122 | [(_ASDisplayView *)self.view __forwardTouchesEnded:touches withEvent:event]; |
134 | | -// if (_viewController) { |
135 | | -// [_viewController touchesEnded:touches withEvent:event]; |
136 | | -// } |
137 | 123 | } |
138 | 124 |
|
139 | 125 | - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event |
140 | 126 | { |
141 | 127 | ASDisplayNodeAssertMainThread(); |
142 | 128 | ASDisplayNodeAssert([self.view isKindOfClass:_ASDisplayView.class], @"ASCellNode views must be of type _ASDisplayView"); |
143 | 129 | [(_ASDisplayView *)self.view __forwardTouchesCancelled:touches withEvent:event]; |
144 | | -// if (_viewController) { |
145 | | -// [_viewController touchesCancelled:touches withEvent:event]; |
146 | | -// } |
147 | 130 | } |
148 | 131 |
|
149 | 132 | @end |
|
0 commit comments