michael's comments

This commit is contained in:
ricky
2016-06-21 14:48:43 -07:00
parent eb715e5836
commit af98d23bf0
2 changed files with 4 additions and 5 deletions

View File

@@ -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<ASLayoutable>)child;

View File

@@ -121,7 +121,7 @@ typedef std::map<unsigned long, id<ASLayoutable>, std::less<unsigned long>> ASCh
_children[0] = finalLayoutable;
[self propagateUpLayoutable:finalLayoutable];
}
} else if (_children.size() > 0) {
} else {
_children.erase(0);
}
}