iam seeing some of the images but not in every row or column any answers. And any ideas on how to print text below every image like a description, I tried in one of them writing denim but it didn't work. Like this:-
In a SwiftUI ForEach, each item must be uniquely Identifiable.
In your ForEach, you use the "id" parameter, to specify how to uniquely identify each item...
ForEach(clothimages, id: \.self)
If your items are not unique (they are not!), then they will not display correctly.
This is how ForEach works.
In your clothimages, it is the image name that must be unique, for the ForEach to work.
Update clothimages, so that all image names are unique.
To print text below your images, try:
func maincustom(content: Image, text: String) -> some View {
VStack {
content
.resizable()
.frame(width: 200, height: 250)
Text(text)
}
.padding(8)
}