0

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?

1 Answers1

2

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];
}
Bimawa
  • 3,535
  • 2
  • 25
  • 45