From 6cbc51dc61637366f4ff59e71454452634b2d332 Mon Sep 17 00:00:00 2001 From: Luke Parham Date: Wed, 16 Dec 2015 23:44:17 -0600 Subject: [PATCH] cleaned up comments --- AsyncDisplayKit.xcodeproj/project.pbxproj | 16 +++++++++++ AsyncDisplayKit/ASCellNode.h | 26 +++++++++++++----- AsyncDisplayKit/ASCellNode.m | 27 ++++--------------- AsyncDisplayKit/ASDisplayNode.h | 1 + AsyncDisplayKit/ASDisplayNode.mm | 2 -- .../Sample/ImageViewController.m | 10 ------- 6 files changed, 42 insertions(+), 40 deletions(-) diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index 4269a60b..10523a66 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -1513,6 +1513,7 @@ 058D09B9195D04C000B7D73C /* Frameworks */, 058D09BA195D04C000B7D73C /* Resources */, 3B9D88CDF51B429C8409E4B6 /* Copy Pods Resources */, + 1B86F48711505F91D5FEF571 /* Embed Pods Frameworks */, ); buildRules = ( ); @@ -1612,6 +1613,21 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 1B86F48711505F91D5FEF571 /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AsyncDisplayKitTests/Pods-AsyncDisplayKitTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 2E61B6A0DB0F436A9DDBE86F /* Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/AsyncDisplayKit/ASCellNode.h b/AsyncDisplayKit/ASCellNode.h index e8cb3e57..4debef75 100644 --- a/AsyncDisplayKit/ASCellNode.h +++ b/AsyncDisplayKit/ASCellNode.h @@ -93,15 +93,29 @@ typedef NSUInteger ASCellNodeAnimation; */ - (void)setNeedsLayout; - - -/* TODO: WRITE DOCUMENTATION */ - +/** + * @abstract Initializes a cell with a given viewControllerBlock. + * + * @param viewControllerBlock The block that will be used to create the view controller whose root view will be used to create the backing view. + * + * @return An ASCellNode created using the root view of the view controller provided by the viewControllerBlock. + * The view controller's root view is resized to match the calcuated size produced during layout. + * + */ - (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock; + +/** + * @abstract Initializes a cell with a given viewControllerBlock. + * + * @param viewBlock The block that will be used to create the backing view. + * @param didLoadBlock The block that will be called after the view created by the viewBlock is loaded + * + * @return An ASCellNode created using the root view of the view controller provided by the viewControllerBlock. + * The view controller's root view is resized to match the calcuated size produced during layout. + * + */ - (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock didLoadBlock:(ASDisplayNodeDidLoadBlock)didLoadBlock; - - @end diff --git a/AsyncDisplayKit/ASCellNode.m b/AsyncDisplayKit/ASCellNode.m index 85c7f520..bc2159c0 100644 --- a/AsyncDisplayKit/ASCellNode.m +++ b/AsyncDisplayKit/ASCellNode.m @@ -19,10 +19,11 @@ #pragma mark ASCellNode @interface ASCellNode (){ -ASDisplayNodeDidLoadBlock _nodeLoadedBlock; -ASDisplayNode *_viewControllerNode; -UIViewController *_viewController; + ASDisplayNodeDidLoadBlock _nodeLoadedBlock; + ASDisplayNode *_viewControllerNode; + UIViewController *_viewController; } + @end @implementation ASCellNode @@ -53,24 +54,18 @@ UIViewController *_viewController; _viewController = viewControllerBlock(); - NSLog(@"%d", _viewController.view.gestureRecognizers.count); -// for (UIGestureRecognizer *recognizer in [_viewController.view gestureRecognizers]) { -// -// } - _viewControllerNode = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{ return _viewController.view; } didLoadBlock:didLoadBlock]; [self addSubnode:_viewControllerNode]; - _nodeLoadedBlock = didLoadBlock; //not sure where i should plug in to call this... + _nodeLoadedBlock = didLoadBlock; return self; } - (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize { _viewControllerNode.frame = (CGRect){{0,0}, constrainedSize.max}; - return [super layoutSpecThatFits:constrainedSize]; } @@ -111,9 +106,6 @@ UIViewController *_viewController; ASDisplayNodeAssertMainThread(); ASDisplayNodeAssert([self.view isKindOfClass:_ASDisplayView.class], @"ASCellNode views must be of type _ASDisplayView"); [(_ASDisplayView *)self.view __forwardTouchesBegan:touches withEvent:event]; -// if (_viewController) { -// [_viewController touchesBegan:touches withEvent:event]; -// } } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event @@ -121,9 +113,6 @@ UIViewController *_viewController; ASDisplayNodeAssertMainThread(); ASDisplayNodeAssert([self.view isKindOfClass:_ASDisplayView.class], @"ASCellNode views must be of type _ASDisplayView"); [(_ASDisplayView *)self.view __forwardTouchesMoved:touches withEvent:event]; -// if (_viewController) { -// [_viewController touchesMoved:touches withEvent:event]; -// } } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event @@ -131,9 +120,6 @@ UIViewController *_viewController; ASDisplayNodeAssertMainThread(); ASDisplayNodeAssert([self.view isKindOfClass:_ASDisplayView.class], @"ASCellNode views must be of type _ASDisplayView"); [(_ASDisplayView *)self.view __forwardTouchesEnded:touches withEvent:event]; -// if (_viewController) { -// [_viewController touchesEnded:touches withEvent:event]; -// } } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event @@ -141,9 +127,6 @@ UIViewController *_viewController; ASDisplayNodeAssertMainThread(); ASDisplayNodeAssert([self.view isKindOfClass:_ASDisplayView.class], @"ASCellNode views must be of type _ASDisplayView"); [(_ASDisplayView *)self.view __forwardTouchesCancelled:touches withEvent:event]; -// if (_viewController) { -// [_viewController touchesCancelled:touches withEvent:event]; -// } } @end diff --git a/AsyncDisplayKit/ASDisplayNode.h b/AsyncDisplayKit/ASDisplayNode.h index 922684ca..bc6301e2 100644 --- a/AsyncDisplayKit/ASDisplayNode.h +++ b/AsyncDisplayKit/ASDisplayNode.h @@ -98,6 +98,7 @@ typedef NS_OPTIONS(NSUInteger, ASInterfaceState) */ - (id)init; + /** * @abstract Alternative initializer with a block to create the backing view. * diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index 6e6928d9..54e3547b 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -140,7 +140,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) overrides |= ASDisplayNodeMethodOverrideLayoutSpecThatFits; } - return overrides; } @@ -292,7 +291,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) return self; } - - (void)dealloc { ASDisplayNodeAssertMainThread(); diff --git a/examples/CollectionViewWithViewControllerCells/Sample/ImageViewController.m b/examples/CollectionViewWithViewControllerCells/Sample/ImageViewController.m index 3c6cd1c7..77b35b8a 100644 --- a/examples/CollectionViewWithViewControllerCells/Sample/ImageViewController.m +++ b/examples/CollectionViewWithViewControllerCells/Sample/ImageViewController.m @@ -26,16 +26,6 @@ return self; } -- (void)viewDidAppear:(BOOL)animated; -{ - -} - -- (void)viewWillAppear:(BOOL)animated; -{ - -} - - (void)viewDidLoad { [super viewDidLoad];