Skip to content

Instantly share code, notes, and snippets.

@GeekTree0101
Last active May 12, 2018 04:53
Show Gist options
  • Save GeekTree0101/c02c6d469bf9d181f695081792494200 to your computer and use it in GitHub Desktop.
Save GeekTree0101/c02c6d469bf9d181f695081792494200 to your computer and use it in GitHub Desktop.
Sana Info CellNode Example1
override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {
let stackLayout =
ASStackLayoutSpec(direction: .horizontal,
spacing: 10.0,
justifyContent: .start,
alignItems: .center,
children: [profileImageNode,
descriptionNode])
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