Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 6cbc51d

Browse files
committed
cleaned up comments
1 parent fe5a580 commit 6cbc51d

6 files changed

Lines changed: 42 additions & 40 deletions

File tree

AsyncDisplayKit.xcodeproj/project.pbxproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,7 @@
15131513
058D09B9195D04C000B7D73C /* Frameworks */,
15141514
058D09BA195D04C000B7D73C /* Resources */,
15151515
3B9D88CDF51B429C8409E4B6 /* Copy Pods Resources */,
1516+
1B86F48711505F91D5FEF571 /* Embed Pods Frameworks */,
15161517
);
15171518
buildRules = (
15181519
);
@@ -1612,6 +1613,21 @@
16121613
/* End PBXResourcesBuildPhase section */
16131614

16141615
/* Begin PBXShellScriptBuildPhase section */
1616+
1B86F48711505F91D5FEF571 /* Embed Pods Frameworks */ = {
1617+
isa = PBXShellScriptBuildPhase;
1618+
buildActionMask = 2147483647;
1619+
files = (
1620+
);
1621+
inputPaths = (
1622+
);
1623+
name = "Embed Pods Frameworks";
1624+
outputPaths = (
1625+
);
1626+
runOnlyForDeploymentPostprocessing = 0;
1627+
shellPath = /bin/sh;
1628+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AsyncDisplayKitTests/Pods-AsyncDisplayKitTests-frameworks.sh\"\n";
1629+
showEnvVarsInLog = 0;
1630+
};
16151631
2E61B6A0DB0F436A9DDBE86F /* Check Pods Manifest.lock */ = {
16161632
isa = PBXShellScriptBuildPhase;
16171633
buildActionMask = 2147483647;

AsyncDisplayKit/ASCellNode.h

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,28 @@ typedef NSUInteger ASCellNodeAnimation;
9393
*/
9494
- (void)setNeedsLayout;
9595

96-
97-
98-
/* TODO: WRITE DOCUMENTATION */
99-
96+
/**
97+
* @abstract Initializes a cell with a given viewControllerBlock.
98+
*
99+
* @param viewControllerBlock The block that will be used to create the view controller whose root view will be used to create the backing view.
100+
*
101+
* @return An ASCellNode created using the root view of the view controller provided by the viewControllerBlock.
102+
* The view controller's root view is resized to match the calcuated size produced during layout.
103+
*
104+
*/
100105
- (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock;
101-
- (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock didLoadBlock:(ASDisplayNodeDidLoadBlock)didLoadBlock;
102-
103106

107+
/**
108+
* @abstract Initializes a cell with a given viewControllerBlock.
109+
*
110+
* @param viewBlock The block that will be used to create the backing view.
111+
* @param didLoadBlock The block that will be called after the view created by the viewBlock is loaded
112+
*
113+
* @return An ASCellNode created using the root view of the view controller provided by the viewControllerBlock.
114+
* The view controller's root view is resized to match the calcuated size produced during layout.
115+
*
116+
*/
117+
- (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock didLoadBlock:(ASDisplayNodeDidLoadBlock)didLoadBlock;
104118

105119
@end
106120

AsyncDisplayKit/ASCellNode.m

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
#pragma mark ASCellNode
2020

2121
@interface ASCellNode (){
22-
ASDisplayNodeDidLoadBlock _nodeLoadedBlock;
23-
ASDisplayNode *_viewControllerNode;
24-
UIViewController *_viewController;
22+
ASDisplayNodeDidLoadBlock _nodeLoadedBlock;
23+
ASDisplayNode *_viewControllerNode;
24+
UIViewController *_viewController;
2525
}
26+
2627
@end
2728

2829
@implementation ASCellNode
@@ -53,24 +54,18 @@ - (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)vi
5354

5455
_viewController = viewControllerBlock();
5556

56-
NSLog(@"%d", _viewController.view.gestureRecognizers.count);
57-
// for (UIGestureRecognizer *recognizer in [_viewController.view gestureRecognizers]) {
58-
//
59-
// }
60-
6157
_viewControllerNode = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{
6258
return _viewController.view;
6359
} didLoadBlock:didLoadBlock];
6460

6561
[self addSubnode:_viewControllerNode];
6662

67-
_nodeLoadedBlock = didLoadBlock; //not sure where i should plug in to call this...
63+
_nodeLoadedBlock = didLoadBlock;
6864
return self;
6965
}
7066

7167
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize {
7268
_viewControllerNode.frame = (CGRect){{0,0}, constrainedSize.max};
73-
7469
return [super layoutSpecThatFits:constrainedSize];
7570
}
7671

@@ -111,39 +106,27 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
111106
ASDisplayNodeAssertMainThread();
112107
ASDisplayNodeAssert([self.view isKindOfClass:_ASDisplayView.class], @"ASCellNode views must be of type _ASDisplayView");
113108
[(_ASDisplayView *)self.view __forwardTouchesBegan:touches withEvent:event];
114-
// if (_viewController) {
115-
// [_viewController touchesBegan:touches withEvent:event];
116-
// }
117109
}
118110

119111
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
120112
{
121113
ASDisplayNodeAssertMainThread();
122114
ASDisplayNodeAssert([self.view isKindOfClass:_ASDisplayView.class], @"ASCellNode views must be of type _ASDisplayView");
123115
[(_ASDisplayView *)self.view __forwardTouchesMoved:touches withEvent:event];
124-
// if (_viewController) {
125-
// [_viewController touchesMoved:touches withEvent:event];
126-
// }
127116
}
128117

129118
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
130119
{
131120
ASDisplayNodeAssertMainThread();
132121
ASDisplayNodeAssert([self.view isKindOfClass:_ASDisplayView.class], @"ASCellNode views must be of type _ASDisplayView");
133122
[(_ASDisplayView *)self.view __forwardTouchesEnded:touches withEvent:event];
134-
// if (_viewController) {
135-
// [_viewController touchesEnded:touches withEvent:event];
136-
// }
137123
}
138124

139125
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
140126
{
141127
ASDisplayNodeAssertMainThread();
142128
ASDisplayNodeAssert([self.view isKindOfClass:_ASDisplayView.class], @"ASCellNode views must be of type _ASDisplayView");
143129
[(_ASDisplayView *)self.view __forwardTouchesCancelled:touches withEvent:event];
144-
// if (_viewController) {
145-
// [_viewController touchesCancelled:touches withEvent:event];
146-
// }
147130
}
148131

149132
@end

AsyncDisplayKit/ASDisplayNode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ typedef NS_OPTIONS(NSUInteger, ASInterfaceState)
9898
*/
9999
- (id)init;
100100

101+
101102
/**
102103
* @abstract Alternative initializer with a block to create the backing view.
103104
*

AsyncDisplayKit/ASDisplayNode.mm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
140140
overrides |= ASDisplayNodeMethodOverrideLayoutSpecThatFits;
141141
}
142142

143-
144143
return overrides;
145144
}
146145

@@ -292,7 +291,6 @@ - (id)initWithLayerBlock:(ASDisplayNodeLayerBlock)layerBlock didLoadBlock:(ASDis
292291
return self;
293292
}
294293

295-
296294
- (void)dealloc
297295
{
298296
ASDisplayNodeAssertMainThread();

examples/CollectionViewWithViewControllerCells/Sample/ImageViewController.m

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ - (instancetype)initWithImage:(UIImage *)image {
2626
return self;
2727
}
2828

29-
- (void)viewDidAppear:(BOOL)animated;
30-
{
31-
32-
}
33-
34-
- (void)viewWillAppear:(BOOL)animated;
35-
{
36-
37-
}
38-
3929
- (void)viewDidLoad {
4030
[super viewDidLoad];
4131

0 commit comments

Comments
 (0)