@@ -66,56 +66,56 @@ private extension StackCellExampleViewController {
6666
6767 // Note that using `UITableViewCell` or `UICollectionViewCell` inside stack is not recommended, but it possible
6868 adapter += TableSection . create ( header: TitleHeaderGenerator ( model: " StackView based cells " ) ,
69- footer: EmptyTableFooterGenerator ( ) ) { it in
70- it. stack (
71- model: . build { vStack in
72- vStack. background ( . solid( . rddm) )
73- vStack. style ( . init( axis: . vertical,
74- spacing: 8 ,
75- alignment: . fill,
76- distribution: . fill) )
77- vStack. children { it in
78- it. gen ( TitleTableViewCell . self, model: " 1 " )
79- it. gen ( TitleTableViewCell . self, model: " 2 " )
80- it. stack ( model: . build { hStack in
81- hStack. background ( . solid( . systemBlue) )
82- hStack. style ( . init( axis: . horizontal,
83- spacing: 4 ,
84- alignment: . fill,
85- distribution: . fillEqually) )
86- hStack. children { it in
87- it. gen ( TitleTableViewCell . self, model: " 4 " )
88- it. gen ( TitleTableViewCell . self, model: " 5 " )
89- }
90- } )
91- it. gen ( TitleTableViewCell . self, model: " 3 " )
92- }
93- } )
94- it. gen ( LabelView . self, model: . build { label in
69+ footer: EmptyTableFooterGenerator ( ) ) { ctx in
70+ StackView . build ( in: ctx, with: . build { vStack in
71+ vStack. background ( . solid( . rddm) )
72+ vStack. style ( . init( axis: . vertical,
73+ spacing: 8 ,
74+ alignment: . fill,
75+ distribution: . fill) )
76+ vStack. children { ctx in
77+ TitleTableViewCell . build ( in: ctx, with: " 1 " )
78+ TitleTableViewCell . build ( in: ctx, with: " 2 " )
79+ StackView . build ( in: ctx, with: . build { hStack in
80+ hStack. background ( . solid( . systemBlue) )
81+ hStack. style ( . init( axis: . horizontal,
82+ spacing: 4 ,
83+ alignment: . fill,
84+ distribution: . fillEqually) )
85+ hStack. children { ctx in
86+ TitleTableViewCell . build ( in: ctx, with: " 4 " )
87+ TitleTableViewCell . build ( in: ctx, with: " 5 " )
88+ }
89+ } )
90+ TitleTableViewCell . build ( in: ctx, with: " 3 " )
91+ }
92+ } )
93+ LabelView . build ( in: ctx, with: . build { label in
9594 label. textAlignment ( . center)
9695 label. text ( . string( " Wrapped LabelView " ) )
9796 label. style ( . init( color: . systemBlue, font: . systemFont( ofSize: 16 ) ) )
9897 } )
99- it. gen ( TitleTableViewCell . self, model: " Cell outside from stack " )
100- it. stack ( model: . build { hStack in
98+ // TODO: - resolve crash with neb loading
99+ // TitleTableViewCell.build(in: ctx, with: "Cell outside from stack")
100+ StackView . build ( in: ctx, with: . build { hStack in
101101 hStack. background ( . solid( . systemGreen) )
102102 hStack. style ( . init( axis: . horizontal,
103103 spacing: 0 ,
104104 alignment: . fill,
105105 distribution: . fillEqually) )
106- hStack. children { it in
107- it . gen ( TitleTableViewCell . self , model : " 6 " )
108- it . stack ( model : . build { vStack in
106+ hStack. children { ctx in
107+ TitleTableViewCell . build ( in : ctx , with : " 6 " )
108+ StackView . build ( in : ctx , with : . build { vStack in
109109 vStack. background ( . solid( . systemPink) )
110110 vStack. style ( . init( axis: . vertical,
111111 spacing: 20 ,
112112 alignment: . fill,
113113 distribution: . fillEqually) )
114- vStack. children { it in
115- it . gen ( TitleTableViewCell . self , model : " 7 " )
116- it . gen ( TitleTableViewCell . self , model : " 8 " )
117- it . gen ( TitleTableViewCell . self , model : " 9 " )
118- it . gen ( TitleTableViewCell . self , model : " 10 " )
114+ vStack. children { ctx in
115+ TitleTableViewCell . build ( in : ctx , with : " 7 " )
116+ TitleTableViewCell . build ( in : ctx , with : " 8 " )
117+ TitleTableViewCell . build ( in : ctx , with : " 9 " )
118+ TitleTableViewCell . build ( in : ctx , with : " 10 " )
119119 }
120120 } )
121121 }
0 commit comments