Reputation: 610
I have ASViewController with root node. In init I add some nodes. I need to display new node after button tap. How I can do it?
Upvotes: 0
Views: 222
Reputation: 3700
Just use Layout Transition
- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
{
ASStackLayoutSpec *stack = [[ASStackLayoutSpec alloc] init];
if (self.buttonState == SignupNodeName) {
[stack setChildren:@[field, self.buttonNode, self.newNode]];
} else {
[stack setChildren:@[field, self.buttonNode]];
}
UIEdgeInsets insets = UIEdgeInsetsMake(15.0, 15.0, 15.0, 15.0);
return [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:stack];
}
Upvotes: 2