cleaned up comments

This commit is contained in:
Luke Parham
2015-12-16 23:44:17 -06:00
parent fe5a58087d
commit 6cbc51dc61
6 changed files with 42 additions and 40 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -98,6 +98,7 @@ typedef NS_OPTIONS(NSUInteger, ASInterfaceState)
*/
- (id)init;
/**
* @abstract Alternative initializer with a block to create the backing view.
*

View File

@@ -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();

View File

@@ -26,16 +26,6 @@
return self;
}
- (void)viewDidAppear:(BOOL)animated;
{
}
- (void)viewWillAppear:(BOOL)animated;
{
}
- (void)viewDidLoad {
[super viewDidLoad];