Created
May 12, 2018 06:15
-
-
Save GeekTree0101/df02586ace0c50e4a0a61d7baf827cc3 to your computer and use it in GitHub Desktop.
UIViewController + Texture Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CatFeedViewController: UIViewController { | |
let backgroundNode = ASDisplayNode() | |
let feedNode = ASTableNode() | |
init() { | |
super.init(nibName: nil, bundle: nil) | |
self.view.addSubnode(backgroundNode) | |
backgroundNode.automaticallyManagesSubnodes = true | |
backgroundNode.layoutSpecBlock = { [weak self] (node, constraintSize) -> ASLayoutSpec in | |
guard let `self` = self else { return ASLayoutSpec() } | |
return ASInsetLayoutSpec(insets: .zero, | |
child: self.feedNode) | |
} | |
backgroundNode.onDidLoad({ [weak self] node in | |
node.view.snp.makeConstraints({ make in | |
make.edges.equalToSuperview() | |
}) | |
feedNode.view.showsVerticalScrollIndicator = false | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment