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 / HeaderNode.swift
Created September 25, 2019 05:59
TextureGram Header Node
import AsyncDisplayKit
class HeaderNode: ASDisplayNode {
// MARK: - Values
private let post: Post
// MARK: - Nodes
private let profilePicture: ASImageNode
@wendyliga
wendyliga / texture-tutorial.swift
Created September 25, 2019 02:44
ASWrapperLayoutSpec Example
let wrapper = ASWrapperLayoutSpec(layoutElement: self.titleNode)
return wrapper
@wendyliga
wendyliga / texture-container-uikit.csv
Created September 25, 2019 02:27
Texture Container Equivalent to UIKit Side
Texture Containers UIKit Equivalent
ASCollectionNode UICollectionView
ASPagerNode UIPageViewController
ASTableNode UITableViewController
ASViewController UIViewController
@wendyliga
wendyliga / texture-uikit.csv
Created September 25, 2019 02:18
Texture Components Equivalent to UIKit Components
Texture Components UIKit Components
ASDisplayNode UIView
ASImageNode UIImageView
ASButtonNode UIButton
ASControlNode UIControl
ASCellNode UITableViewCell / UICollectionViewCell
ASScrollNode UIScrollView
ASEditableTextNode UITextView
ASTextNode UILabel
@wendyliga
wendyliga / texture-tutorial.swift
Created September 24, 2019 09:39
Texture ASAbsoluteLayoutSpec Example
node.style.layoutPosition = CGPoint(x: 0.0, y: maxConstrainedSize.height / 3.0)
node.style.preferredSize = CGSize(width: maxConstrainedSize.width / 2.0, height: maxConstrainedSize.height / 3.0)
return ASAbsoluteLayoutSpec(children: [node])
@wendyliga
wendyliga / texture-tutorial.swift
Created September 24, 2019 09:38
Texture ASRelativeLayoutSpec Example
let relativeSpec = ASRelativeLayoutSpec(horizontalPosition: .start,
verticalPosition: .start,
sizingOption: [],
child: foregroundNode)
@wendyliga
wendyliga / texture-tutorial.swift
Created September 24, 2019 09:37
Texture ASRatioLayoutSpec Simple Example
let subnode = ASDisplayNodeWithBackgroundColor(UIColor.green, CGSize(width: 100, height: 100.0))
let ratioSpec = ASRatioLayoutSpec(ratio: 0.5, child: subnode)
return ratioSpec
@wendyliga
wendyliga / texture-tutorial.swift
Created September 24, 2019 09:37
Texture ASCenterLayoutSpec Simple Example
let center = ASCenterLayoutSpec(centeringOptions: .XY,
sizingOptions: .minimumXY,
child: mainStack)
return center
@wendyliga
wendyliga / texture-tutorial.swift
Created September 24, 2019 09:33
Texture ASBackgroundLayoutSpec Simple Tutorial
let backgroundNode = ASDisplayNodeWithBackgroundColor(UIColor.red)
let foregroundNode = ASDisplayNodeWithBackgroundColor(UIColor.blue)
return ASBackgroundLayoutSpec(child: foregroundNode, background: backgroundNode)
@wendyliga
wendyliga / texture-tutorial.swift
Created September 24, 2019 09:32
Texture ASOverlaySpecLayout Simple Example
let overlayNode = ASDisplayNode()
overlayNode.backgroundColor = UIColor.black.withAlphaComponent(0.3)
let overlay = ASOverlayLayoutSpec(child: mainStack, overlay: self.overlayNode)
return overlay