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