Skip to content

Commit e5920be

Browse files
committed
Update
1 parent 60b7413 commit e5920be

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Development/Development/BookCollectionView.swift

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,43 @@ struct BookCollectionViewCombined: View, PreviewProvider {
185185
return Book()
186186
}
187187

188+
#Preview("H / Custom List / Single selection") {
189+
190+
struct Book: View {
191+
192+
@State var selected: Item?
193+
194+
var body: some View {
195+
CollectionView(
196+
layout: CollectionViewLayouts.List(
197+
direction: .horizontal
198+
),
199+
content: {
200+
SelectableForEach(
201+
data: Item.mock(30),
202+
selection: .single(
203+
selected: selected,
204+
onChange: { e in
205+
selected = e
206+
}
207+
),
208+
selectionIdentifier: \.self,
209+
cell: { index, item in
210+
Cell(index: index, item: item)
211+
}
212+
)
213+
}
214+
)
215+
.onAdditionalLoading(isEnabled: true, leadingScreens: 1, isLoading: .constant(true)) {
216+
print("onLoad next")
217+
}
218+
}
219+
}
220+
221+
return Book()
222+
}
223+
224+
188225
#Preview("Custom List / Multiple selection") {
189226

190227
struct Book: View {

0 commit comments

Comments
 (0)