Skip to content

Instantly share code, notes, and snippets.

@GeekTree0101
Last active May 12, 2018 04:54
Show Gist options
  • Save GeekTree0101/3ca790d2d9a1aa1e0796bcbcb9eee8af to your computer and use it in GitHub Desktop.
Save GeekTree0101/3ca790d2d9a1aa1e0796bcbcb9eee8af to your computer and use it in GitHub Desktop.
Sana Info CellNode Example 2
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
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