I want to maintain a 1/1 square aspect ratio (equal width and height) without specifying an exact height/width. This is proving unreasonably hard. My code is below.
Image(.personsmiling)
.resizable()
.aspectRatio(1/1, contentMode: .fill)
.padding()
Previously I have used scaledToFill()
and clipped()
but that approach doesn't work here