I have the following:
It shows just 1 image if 1 is available or if more than one image is there, it creates a HStack which should be scrollable to show all images:
ScrollView {
VStack (alignment: .leading) {
if userData.profileURL1 != nil {
ScrollView(.horizontal, showsIndicators: false) {
HStack {
URLImage(URL(string: userData.profileURL)!, placeholder: Image(systemName: "circle"),
content: {
$0.image
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: (UIScreen.main.bounds.width - 33),height: 500)
}
)
.cornerRadius(12)
.padding([.leading,.trailing])
URLImage(URL(string: userData.profileURL1!)!, placeholder: Image(systemName: "circle"),
content: {
$0.image
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: (UIScreen.main.bounds.width - 33),height: 500)
}
)
.cornerRadius(12)
.padding([.leading,.trailing])
if userData.profileURL2 != nil {
URLImage(URL(string: userData.profileURL2!)!, placeholder: Image(systemName: "circle"),
content: {
$0.image
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: (UIScreen.main.bounds.width - 33),height: 500)
}
)
.cornerRadius(12)
.padding([.leading,.trailing])
}
}
}
} else {
URLImage(URL(string: userData.profileURL)!, placeholder: Image(systemName: "circle"),
content: {
$0.image
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: (UIScreen.main.bounds.width - 33),height: 500)
}
)
.cornerRadius(12)
.padding([.leading,.trailing])
}
}
}
The logic works and it displays multiple images if more than one are there, but doesn't show them correctly, the height of the images is not being applied from what I can tell:
The images are scrolling to show the other but the height is all messed up. But when only 1 image is present (else) then the image shows fine, full height and everything.


HStack.