Closed ethanyuwang closed 3 years ago
Hey! Any luck on a solution?
Hi, I believe the issue here is that you are trying to initialize the grid with a type Published<[UIImage]>.Publisher
and the generic parameter 'ID' of the collection could not be inferred.
try:
private var gallery: some View {
WaterfallGrid(self.loader.images, id:\.self) { uiImage in
Image(uiImage: uiImage).resizable().aspectRatio(contentMode: .fit).cornerRadius(10)
}
.gridStyle(columns: 2)
}
Does uiImage class extends Identifiable, Hashable ?
I followed the example to use WaterfallGrid but keep getting
Cannot convert value of type 'some View' to closure result type '_'
on line:Image(uiImage: uiImage).resizable().aspectRatio(contentMode: .fit).cornerRadius(10)