Skip to content

Instantly share code, notes, and snippets.

View wendyliga's full-sized avatar
👨‍💻
Code in Progress

Wendy Liga wendyliga

👨‍💻
Code in Progress
View GitHub Profile
@wendyliga
wendyliga / texture-tutorial.swift
Created September 24, 2019 09:30
Texture ASInsetLayoutSpec Simple Example
let mainStack = ASStackLayoutSpec(direction: .horizontal,
spacing: 6, justifyContent: .start,
alignItems: .center,
children: [self.titleNode, self.subtitleNode])
let padding = ASInsetLayoutSpec(insets: UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15), child: mainStack)
return padding
@wendyliga
wendyliga / texture-tutorial.swift
Created September 24, 2019 09:29
Texture ASStackLayoutSpec Simple Example
let mainStack = ASStackLayoutSpec(direction: .horizontal,
spacing: 6.0,
justifyContent: .start,
alignItems: .center,
children: [titleNode, subtitleNode])
return mainStack
@wendyliga
wendyliga / texture-tutorial.swift
Created September 24, 2019 09:29
Texture LayoutSpec
node.layoutSpecBlock = {_,_ in
return ASWrapperLayoutSpec(layoutElement: self.titleNode)
}
@wendyliga
wendyliga / texture-tutorial.swift
Last active September 24, 2019 09:39
Texture ASViewController Example
class ViewController: ASViewController<ASDisplayNode> {
init() {
super.init(node: ASDisplayNode())
self.node.backgroundColor = .white
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")