From af98d23bf01fbb919492cb79a4e3d277749159b6 Mon Sep 17 00:00:00 2001 From: ricky Date: Tue, 21 Jun 2016 14:48:43 -0700 Subject: [PATCH] michael's comments --- AsyncDisplayKit/Layout/ASLayoutSpec.h | 7 +++---- AsyncDisplayKit/Layout/ASLayoutSpec.mm | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/AsyncDisplayKit/Layout/ASLayoutSpec.h b/AsyncDisplayKit/Layout/ASLayoutSpec.h index 7d7e4bc5d4..97f9fe1ca8 100644 --- a/AsyncDisplayKit/Layout/ASLayoutSpec.h +++ b/AsyncDisplayKit/Layout/ASLayoutSpec.h @@ -40,10 +40,9 @@ NS_ASSUME_NONNULL_BEGIN * only require a single child. * * For layout specs that require a known number of children (ASBackgroundLayoutSpec, for example) - * a subclass should use this method to set the "primary" child. It can then use setChild:forIdentifier: - * to set any other required children. Ideally a subclass would hide this from the user, and use the - * setChild:forIdentifier: internally. For example, ASBackgroundLayoutSpec exposes a backgroundChild - * property that behind the scenes is calling setChild:forIdentifier:. + * a subclass should use this method to set the "primary" child. This is actually the same as calling + * setChild:forIdentifier:0. All other children should be set by defining convenience methods + * that call setChild:forIdentifier behind the scenes. */ - (void)setChild:(id)child; diff --git a/AsyncDisplayKit/Layout/ASLayoutSpec.mm b/AsyncDisplayKit/Layout/ASLayoutSpec.mm index a366cc5848..b0bd8ee8ed 100644 --- a/AsyncDisplayKit/Layout/ASLayoutSpec.mm +++ b/AsyncDisplayKit/Layout/ASLayoutSpec.mm @@ -121,7 +121,7 @@ typedef std::map, std::less> ASCh _children[0] = finalLayoutable; [self propagateUpLayoutable:finalLayoutable]; } - } else if (_children.size() > 0) { + } else { _children.erase(0); } }