@@ -65,62 +65,58 @@ private extension StackCellExampleViewController {
6565
6666 // Note that using `UITableViewCell` or `UICollectionViewCell` inside stack is not recommended, but it possible
6767 adapter += Section ( header: TitleHeaderGenerator ( model: " StackView based cells " ) , footer: EmptyTableFooterGenerator ( ) ) {
68- StackView . rddm . tableGenerator ( with : . build { vStack in
68+ Stack ( model : . build { vStack in
6969 vStack. background ( . solid( . rddm) )
7070 vStack. style ( . init( axis: . vertical,
7171 spacing: 8 ,
7272 alignment: . fill,
7373 distribution: . fill) )
74- vStack. children ( [
75- TitleTableViewCell . rddm. baseStackGenerator ( with: " 1 " , and: . nib) ,
76- TitleTableViewCell . rddm. baseStackGenerator ( with: " 2 " , and: . nib) ,
77- StackView . rddm. baseStackGenerator ( with: . build { hStack in
78- hStack. background ( . solid( . systemBlue) )
79- hStack. style ( . init( axis: . horizontal,
80- spacing: 4 ,
81- alignment: . fill,
82- distribution: . fillEqually) )
83-
84- hStack. children ( [
85- TitleTableViewCell . rddm. baseStackGenerator ( with: " 4 " , and: . nib) ,
86- TitleTableViewCell . rddm. baseStackGenerator ( with: " 5 " , and: . nib)
87- ] )
88- } ) ,
89- TitleTableViewCell . rddm. baseStackGenerator ( with: " 3 " , and: . nib)
90- ] )
91- } , and: . class)
74+ } ) {
75+ TitleTableViewCell . rddm. viewGenerator ( with: " 1 " , and: . nib)
76+ TitleTableViewCell . rddm. viewGenerator ( with: " 2 " , and: . nib)
77+ StackView . rddm. viewGenerator ( with: . build { hStack in
78+ hStack. background ( . solid( . systemBlue) )
79+ hStack. style ( . init( axis: . horizontal,
80+ spacing: 4 ,
81+ alignment: . fill,
82+ distribution: . fillEqually) )
83+
84+ hStack. children ( [
85+ TitleTableViewCell . rddm. viewGenerator ( with: " 4 " , and: . nib) ,
86+ TitleTableViewCell . rddm. viewGenerator ( with: " 5 " , and: . nib)
87+ ] )
88+ } )
89+ TitleTableViewCell . rddm. viewGenerator ( with: " 3 " , and: . nib)
90+ }
9291 LabelView . rddm. tableGenerator ( with: . build { label in
9392 label. textAlignment ( . center)
9493 label. text ( . string( " Wrapped LabelView " ) )
9594 label. style ( . init( color: . systemBlue, font: . systemFont( ofSize: 16 ) ) )
9695 } , and: . class)
9796 TitleTableViewCell . rddm. baseGenerator ( with: " Cell outside from stack " , and: . nib)
98- StackView . rddm . tableGenerator ( with : . build { hStack in
97+ Stack ( model : . build { hStack in
9998 hStack. background ( . solid( . systemGreen) )
10099 hStack. style ( . init( axis: . horizontal,
101100 spacing: 0 ,
102101 alignment: . fill,
103102 distribution: . fillEqually) )
104- hStack. children ( [
105- TitleTableViewCell . rddm. baseStackGenerator ( with: " 6 " , and: . nib) ,
106- StackView . rddm. baseStackGenerator ( with: . build { vStack in
107- vStack. background ( . solid( . systemPink) )
108- vStack. style ( . init( axis: . vertical,
109- spacing: 20 ,
110- alignment: . fill,
111- distribution: . fillEqually) )
112- vStack. children ( [
113- TitleTableViewCell . rddm. baseStackGenerator ( with: " 6 " , and: . nib) ,
114- TitleTableViewCell . rddm. baseStackGenerator ( with: " 7 " , and: . nib) ,
115- TitleTableViewCell . rddm. baseStackGenerator ( with: " 8 " , and: . nib) ,
116- TitleTableViewCell . rddm. baseStackGenerator ( with: " 9 " , and: . nib)
117- ] )
118- } ,
119- and: . class)
120- ] )
121-
122- } ,
123- and: . class)
103+ } ) {
104+ TitleTableViewCell . rddm. viewGenerator ( with: " 6 " , and: . nib)
105+ StackView . rddm. viewGenerator ( with: . build { vStack in
106+ vStack. background ( . solid( . systemPink) )
107+ vStack. style ( . init( axis: . vertical,
108+ spacing: 20 ,
109+ alignment: . fill,
110+ distribution: . fillEqually) )
111+ vStack. children ( [
112+ TitleTableViewCell . rddm. viewGenerator ( with: " 6 " , and: . nib) ,
113+ TitleTableViewCell . rddm. viewGenerator ( with: " 7 " , and: . nib) ,
114+ TitleTableViewCell . rddm. viewGenerator ( with: " 8 " , and: . nib) ,
115+ TitleTableViewCell . rddm. viewGenerator ( with: " 9 " , and: . nib)
116+ ] )
117+ } ,
118+ and: . class)
119+ }
124120 }
125121
126122 // Tell adapter that we've changed generators
0 commit comments