-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Patch * 🌲 Update
- Loading branch information
Showing
33 changed files
with
315 additions
and
715 deletions.
There are no files selected for viewing
384 changes: 106 additions & 278 deletions
384
TextureBridging.xcodeproj/project.pbxproj → ...TextureBridging.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ject.xcworkspace/contents.xcworkspacedata → ...ject.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
59 changes: 59 additions & 0 deletions
59
...pment/TextureBridging.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"pins" : [ | ||
{ | ||
"identity" : "descriptors", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/FluidGroup/Descriptors", | ||
"state" : { | ||
"revision" : "f41ce2605a76c5d378fe8c5e8c5c98b544dfd108", | ||
"version" : "0.2.3" | ||
} | ||
}, | ||
{ | ||
"identity" : "mondrianlayout", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/FluidGroup/MondrianLayout.git", | ||
"state" : { | ||
"revision" : "5f00b13984fe08316fc5b5be06e2f41c14a3befa", | ||
"version" : "0.10.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "stackscrollview", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/FluidGroup/StackScrollView", | ||
"state" : { | ||
"revision" : "c7d2950cdaee7f4aa0dfd1a1364d352f841c9954", | ||
"version" : "1.6.3" | ||
} | ||
}, | ||
{ | ||
"identity" : "texture", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/FluidGroup/Texture.git", | ||
"state" : { | ||
"revision" : "68df47f0d26522da76b06f22e9a97e4d4ab58dad", | ||
"version" : "3.0.2" | ||
} | ||
}, | ||
{ | ||
"identity" : "textureswiftsupport", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/FluidGroup/TextureSwiftSupport", | ||
"state" : { | ||
"revision" : "fb748d6a9d0a2dca0635227e1db0360fd26e0e24", | ||
"version" : "3.20.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "typedtextattributes", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/muukii/TypedTextAttributes.git", | ||
"state" : { | ||
"revision" : "22aadd76b1cfe7a0702200990c9c5b8f4d33a912", | ||
"version" : "1.5.0" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
125 changes: 125 additions & 0 deletions
125
Development/TextureBridgingDemo/DemoStackScrollViewController.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
// | ||
// DemoStackScrollViewController.swift | ||
// TextureBridgingDemo | ||
// | ||
// Created by muukii on 2020/06/09. | ||
// Copyright © 2020 muukii. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import MondrianLayout | ||
import StackScrollView | ||
import TextureSwiftSupport | ||
import TextureBridging | ||
|
||
final class DemoStackScrollViewController: UIViewController { | ||
|
||
private let stackScrollView = StackScrollView() | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
view.addSubview(stackScrollView) | ||
|
||
Mondrian.buildSubviews(on: view) { | ||
ZStackBlock(alignment: .attach(.all)) { | ||
stackScrollView | ||
} | ||
} | ||
|
||
stackScrollView.append(view: NodeView(node: Component())) | ||
stackScrollView.append(view: NodeView(node: FlexWrapComponent())) | ||
} | ||
} | ||
|
||
extension DemoStackScrollViewController { | ||
|
||
final class Component: ASDisplayNode { | ||
|
||
private let textNode = ASTextNode() | ||
|
||
override init() { | ||
super.init() | ||
|
||
automaticallyManagesSubnodes = true | ||
|
||
backgroundColor = .orange | ||
|
||
textNode.attributedText = NSAttributedString(string: """ | ||
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. | ||
""") | ||
} | ||
|
||
override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec { | ||
LayoutSpec { | ||
textNode | ||
} | ||
} | ||
|
||
} | ||
|
||
final class FlexWrapComponent: ASDisplayNode { | ||
|
||
private let nodes: [ASTextNode] | ||
|
||
override init() { | ||
|
||
let nodes = (0..<30).map { i -> ASTextNode in | ||
let text = ASTextNode() | ||
text.attributedText = NSAttributedString(string: "Hello") | ||
return text | ||
} | ||
|
||
self.nodes = nodes | ||
|
||
super.init() | ||
|
||
backgroundColor = .red | ||
|
||
automaticallyManagesSubnodes = true | ||
|
||
} | ||
|
||
override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec { | ||
LayoutSpec { | ||
HStackLayout(spacing: 0, justifyContent: .start, alignItems: .center, flexWrap: .wrap(lineSpacing: 10, alignContent: .start), isConcurrent: false) { | ||
nodes | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
final class HorizontalNoWrapComponent: ASDisplayNode { | ||
|
||
private let nodes: [ASTextNode] | ||
|
||
override init() { | ||
|
||
let nodes = (0..<30).map { i -> ASTextNode in | ||
let text = ASTextNode() | ||
text.attributedText = NSAttributedString(string: "Hello") | ||
return text | ||
} | ||
|
||
self.nodes = nodes | ||
|
||
super.init() | ||
|
||
backgroundColor = .orange | ||
|
||
automaticallyManagesSubnodes = true | ||
|
||
} | ||
|
||
override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec { | ||
LayoutSpec { | ||
HStackLayout(spacing: 0, justifyContent: .start, alignItems: .center, flexWrap: .wrap(lineSpacing: 10, alignContent: .start), isConcurrent: false) { | ||
nodes | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
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
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
Oops, something went wrong.