Skip to content

Instantly share code, notes, and snippets.

@GeekTree0101
Last active May 12, 2018 04:54
Show Gist options
  • Save GeekTree0101/af5f48668fcbbb9eb76f96101dd5d1c2 to your computer and use it in GitHub Desktop.
Save GeekTree0101/af5f48668fcbbb9eb76f96101dd5d1c2 to your computer and use it in GitHub Desktop.
Sana Info CellNode Example 3
override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {
let stackLayout =
ASStackLayoutSpec(direction: .horizontal,
spacing: 10.0,
justifyContent: .start,
alignItems: .center,
children: [profileImageNode,
descriptionNode])
stackLayout.style.flexShrink = 1.0
descriptionNode.style.flexShrink = 1.0
let stackLayout2 =
ASStackLayoutSpec(direction: .horizontal,
spacing: 10.0,
justifyContent: .spaceBetween,
alignItems: .center,
children: [stackLayout,
buttonNode])
let insets: UIEdgeInsets = .init(top: 10.0,
left: 15.0,
bottom: 10.0,
right: 15.0)
return ASInsetLayoutSpec(insets: insets,
child: stackLayout2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment