@@ -12,9 +12,9 @@ let contentWidth: CGFloat = UIScreen.main.bounds.width - 32
1212
1313class HVStackWrapperViewDemoViewController : UIViewController {
1414
15- let content = VStackLayerWrapperView {
16- HStackLayerWrapperView ( ) {
17- VStackLayerWrapperView ( alignment: . left) {
15+ let content = VStackView {
16+ HStackView ( ) {
17+ VStackView ( alignment: . left) {
1818 UILabel ( ) . stack. then {
1919 $0. text = " Good Morning. "
2020 $0. font = . systemFont( ofSize: 16 , weight: . medium)
@@ -31,7 +31,7 @@ class HVStackWrapperViewDemoViewController: UIViewController {
3131 Spacer ( )
3232
3333 // ICON
34- HStackLayerWrapperView ( distribution: . spacing( 10 ) ) {
34+ HStackView ( distribution: . spacing( 10 ) ) {
3535 UIView ( ) . stack. size ( 34 ) . then {
3636 $0. backgroundColor = . systemPink
3737 $0. layer. cornerRadius = 8
@@ -48,13 +48,13 @@ class HVStackWrapperViewDemoViewController: UIViewController {
4848
4949 Spacer ( length: 20 )
5050
51- HStackLayerWrapperView {
52- HStackLayerWrapperView ( distribution: . spacing( 6 ) ) {
51+ HStackView {
52+ HStackView ( distribution: . spacing( 6 ) ) {
5353 UIView ( ) . stack. size ( 60 ) . then {
5454 $0. backgroundColor = . systemPink
5555 $0. layer. cornerRadius = 8
5656 }
57- VStackLayerWrapperView ( alignment: . left) {
57+ VStackView ( alignment: . left) {
5858 UILabel ( ) . stack. then {
5959 $0. text = " Spending "
6060 $0. font = . systemFont( ofSize: 18 )
@@ -68,12 +68,12 @@ class HVStackWrapperViewDemoViewController: UIViewController {
6868 }
6969 }
7070 Spacer ( )
71- HStackLayerWrapperView ( distribution: . spacing( 6 ) ) {
71+ HStackView ( distribution: . spacing( 6 ) ) {
7272 UIView ( ) . stack. size ( 60 ) . then {
7373 $0. backgroundColor = . systemPink
7474 $0. layer. cornerRadius = 8
7575 }
76- VStackLayerWrapperView ( alignment: . left) {
76+ VStackView ( alignment: . left) {
7777 UILabel ( ) . stack. then {
7878 $0. text = " Income "
7979 $0. font = . systemFont( ofSize: 18 )
@@ -89,7 +89,7 @@ class HVStackWrapperViewDemoViewController: UIViewController {
8989 } . stack. width ( contentWidth) . sizeToFit ( . width)
9090
9191 Spacer ( length: 30 )
92- HStackLayerWrapperView ( alignment: . bottom) {
92+ HStackView ( alignment: . bottom) {
9393 UILabel ( ) . stack. then {
9494 $0. text = " Transactions "
9595 $0. font = . systemFont( ofSize: 24 , weight: . bold)
@@ -104,15 +104,15 @@ class HVStackWrapperViewDemoViewController: UIViewController {
104104 } . stack. width ( contentWidth) . sizeToFit ( . width)
105105
106106 Spacer ( length: 20 )
107- VStackLayerWrapperView ( alignment: . left) {
107+ VStackView ( alignment: . left) {
108108
109- HStackLayerWrapperView {
109+ HStackView {
110110 UIView ( ) . stack. size ( 40 ) . then {
111111 $0. backgroundColor = . systemPink
112112 $0. layer. cornerRadius = 12
113113 }
114114 Spacer ( length: 10 )
115- VStackLayerWrapperView ( alignment: . left) {
115+ VStackView ( alignment: . left) {
116116 UILabel ( ) . stack. then {
117117 $0. text = " Freelance Work "
118118 $0. textColor = . black
@@ -139,6 +139,20 @@ class HVStackWrapperViewDemoViewController: UIViewController {
139139
140140 // Do any additional setup after loading the view.
141141
142+
143+ let textLayer = CATextLayer ( )
144+ textLayer. string = " This is CATextLayer in VStackLayerWrapperView2 "
145+ textLayer. fontSize = 12
146+ textLayer. foregroundColor = UIColor . black. cgColor
147+ textLayer. contentsScale = UIScreen . main. scale
148+
149+ content. addContent {
150+ VStackLayerContainerView {
151+ Spacer ( length: 20 )
152+ textLayer
153+ }
154+ }
155+
142156 self . view. addSubview ( content)
143157 }
144158
0 commit comments