Skip to content

Commit f0077d0

Browse files
authored
Merge pull request #23 from wsu-nyt/patch/texture_readme
Updated README for Texture benchmark
2 parents a59d6e7 + c888bd2 commit f0077d0

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

LayoutFrameworkBenchmark/FeedItemTextureNode.swift

+6-8
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class FeedItemTextureNode: ASCellNode {
3232

3333
override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {
3434
let mainStack = ASStackLayoutSpec(direction: .vertical,
35-
spacing: 0.0,
35+
spacing: 4.0,
3636
justifyContent: .spaceBetween,
3737
alignItems: .stretch,
3838
children: [topBarView, miniProfileView, miniContentView, socialActionsView, commentView])
@@ -57,9 +57,9 @@ class CommentNode: ASDisplayNode {
5757
override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {
5858
actorCommentLabel.style.flexGrow = 1.0
5959
let mainStack = ASStackLayoutSpec(direction: .horizontal,
60-
spacing: 0.0,
60+
spacing: 4.0,
6161
justifyContent: .spaceBetween,
62-
alignItems: .start,
62+
alignItems: .center,
6363
children: [actorImageView, actorCommentLabel])
6464
return mainStack
6565
}
@@ -96,8 +96,6 @@ class MiniProfileNode: ASDisplayNode {
9696
let posterImageView: ASImageNode = {
9797
let i = ASImageNode()
9898
i.image = UIImage(named: "50x50.png")
99-
i.backgroundColor = UIColor.orange
100-
i.contentMode = .center
10199
return i
102100
}()
103101

@@ -128,13 +126,13 @@ class MiniProfileNode: ASDisplayNode {
128126
}
129127

130128
override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {
131-
let textStack = ASStackLayoutSpec(direction: .vertical, spacing: 1.0, justifyContent: .spaceBetween, alignItems: .stretch, children: [posterNameLabel, posterHeadlineLabel, posterTimeLabel])
129+
let textStack = ASStackLayoutSpec(direction: .vertical, spacing: 2.0, justifyContent: .spaceBetween, alignItems: .stretch, children: [posterNameLabel, posterHeadlineLabel, posterTimeLabel])
132130
textStack.style.flexGrow = 1.0
133131

134132
let imageTextStack = ASStackLayoutSpec(direction: .horizontal,
135-
spacing: 2.0,
133+
spacing: 4.0,
136134
justifyContent: .spaceBetween,
137-
alignItems: .start,
135+
alignItems: .center,
138136
children: [posterImageView,
139137
textStack])
140138

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ Layout your views without Auto Layout constraints, in a much more swifty way.
7676
Fast Swift UIViews layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainable.
7777
[PinLayout benchmark's source code](https://github.com/layoutBox/LayoutFrameworkBenchmark/blob/master/LayoutFrameworkBenchmark/Benchmarks/PinLayout/FeedItemPinLayoutView.swift)
7878

79+
* [**Texture**](https://github.com/TextureGroup/Texture)
80+
Optimize your app by making user interfaces thread safe, which means that you will be able to shift all expensive views into background threads.
81+
[Texture benchmark's source code](https://github.com/layoutBox/LayoutFrameworkBenchmark/blob/master/LayoutFrameworkBenchmark/FeedItemTextureNode.swift)
82+
7983
* **UIStackViews**
8084
Apple's UIStackViews.
8185
[UIStackViews benchmark's source code](https://github.com/layoutBox/LayoutFrameworkBenchmark/blob/master/LayoutFrameworkBenchmark/Benchmarks/UIStackView/FeedItemUIStackView.swift)
@@ -98,6 +102,7 @@ Here are the benchmark rendering results to compare visual results:
98102
* [Manual layout rendering result](docs_markdown/benchmark_result_ManualLayout.png)
99103
* [NKFrameLayoutKit rendering result](docs_markdown/benchmark_result_NKFrameLayoutKit.png)
100104
* [PinLayout rendering result](docs_markdown/benchmark_result_PinLayout.png)
105+
* [Texture rendering result](docs_markdown/benchmark_result_Texture.png)
101106

102107
:pushpin: Some work would be required to adjust the layout so that they all match perfectly.
103108

195 KB
Loading

0 commit comments

Comments
 (0)