This file contains 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
Texture Components | UIKit Components | |
---|---|---|
ASDisplayNode | UIView | |
ASImageNode | UIImageView | |
ASButtonNode | UIButton | |
ASControlNode | UIControl | |
ASCellNode | UITableViewCell / UICollectionViewCell | |
ASScrollNode | UIScrollView | |
ASEditableTextNode | UITextView | |
ASTextNode | UILabel |
This file contains 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
Texture Containers | UIKit Equivalent | |
---|---|---|
ASCollectionNode | UICollectionView | |
ASPagerNode | UIPageViewController | |
ASTableNode | UITableViewController | |
ASViewController | UIViewController |
This file contains 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
let wrapper = ASWrapperLayoutSpec(layoutElement: self.titleNode) | |
return wrapper |
This file contains 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
import AsyncDisplayKit | |
class HeaderNode: ASDisplayNode { | |
// MARK: - Values | |
private let post: Post | |
// MARK: - Nodes | |
private let profilePicture: ASImageNode |
This file contains 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
import AsyncDisplayKit | |
class ActionNode: ASDisplayNode { | |
// MARK: - Nodes | |
private let loveButton: ASImageNode | |
private let commentButton: ASImageNode | |
private let shareButton: ASImageNode | |
This file contains 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
import AsyncDisplayKit | |
class PostCell: ASCellNode { | |
let post: Post | |
// MARK: - Nodes | |
let headerNode: HeaderNode | |
let postImage: ASImageNode | |
let actionNode: ActionNode |
This file contains 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
import AsyncDisplayKit | |
class PostNode: ASTableNode { | |
private let posts: [Post] | |
init(posts: [Post]) { | |
self.posts = posts | |
super.init(style: .plain) | |
This file contains 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
import AsyncDisplayKit | |
class StoryCell: ASCellNode { | |
private let story: Story | |
// MARK: - Nodes | |
private let userPicture: ASImageNode | |
private let userName: ASTextNode | |
init(story: Story) { |
This file contains 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
import AsyncDisplayKit | |
class StoryNode: ASCollectionNode{ | |
let stories: [Story] | |
init(stories: [Story]) { | |
self.stories = stories | |
let layout = UICollectionViewFlowLayout() | |
layout.scrollDirection = .horizontal |
This file contains 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
import AsyncDisplayKit | |
class ViewController: ASViewController<ASDisplayNode> { | |
private let storyNode: StoryNode | |
private let postNode: PostNode | |
init() { | |
self.storyNode = StoryNode(stories: Story.generateDummyStory()) | |
self.postNode = PostNode(posts: Post.generateDummyPosts()) |