@@ -48,7 +48,7 @@ private extension StackCellExampleViewController {
4848 func fillAdapter( ) {
4949
5050 // Add section into adapter
51- adapter += Section ( header: EmptyTableHeaderGenerator ( ) , footer: EmptyTableFooterGenerator ( ) ) {
51+ adapter += Section ( header: TitleHeaderGenerator ( model : " TableVStack " ) , footer: EmptyTableFooterGenerator ( ) ) {
5252 TableVStack {
5353 TitleTableViewCell . buildView ( with: " Текст 1 " )
5454 TitleTableViewCell . buildView ( with: " Текст 2 " )
@@ -63,6 +63,34 @@ private extension StackCellExampleViewController {
6363 }
6464 }
6565
66+ // Note that using `UITableViewCell` or `UICollectionViewCell` inside stack is not recommended, but it possible
67+ adapter += Section ( header: TitleHeaderGenerator ( model: " StackView based cells " ) , footer: EmptyTableFooterGenerator ( ) ) {
68+ StackView . rddm. tableGenerator ( with: . build { vStack in
69+ vStack. background ( . solid( . rddm) )
70+ vStack. style ( . init( axis: . vertical,
71+ spacing: 8 ,
72+ alignment: . fill,
73+ 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)
92+ }
93+
6694 // Tell adapter that we've changed generators
6795 adapter => . reload
6896 }
0 commit comments