apptekstudios / ASCollectionView

A SwiftUI collection view with support for custom layouts, preloading, and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can i do add onCellEvent ?

c941010623 opened this issue · comments

if i use the sample code:

ASCollectionView(data: dataExample, dataID: \.self) { item, _ in
			Color.blue
				.overlay(Text("\(item)"))
		}
		.layout {
			.grid(layoutMode: .adaptive(withMinItemSize: 100),
				  itemSpacing: 5,
				  lineSpacing: 5,
				  itemSize: .absolute(50))
		}

how can i do add onCellEvent ??

Hi @c941010623, to add onCellEvent just use the ASSection initialiser 👍

ASCollectionView(section:
   ASSection(id: 0, data: dataExample, dataID: \.self, onCellEvent: {...}) 
       {...}
)
.layout {...}