image aspect ratio programmatically swift code example
Example: swiftui image aspect ratio
VStack {
GeometryReader { geo in
Image("Example")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: geo.size.width, height: 300)
}
}