title: SwiftUI: Dynamically set size for Image
body: <p>I want to show an image in a View, where the image source will vary in size.
  Is there a way to dynamically adjust the size of the image to the width of the containing view or get the screen size even?
  I have a horizontal scrollview with each element being a Stack of an image and a text. I would like to size every image depending on the screen width, since I want to be independent of the device. 
  How would you do that in SwiftUI?
  Thanks!</p>
  
  <pre><code>struct ImageRow: View {
      var items: [ImageWithDescription]
  
      var body: some View {
  
          ScrollView(showsHorizontalIndicator: false) {
                  HStack(alignment: .bottom){
  
                      ForEach(self.items.identified(by: \.name)) { item in
                         Spacer()
                          VStack {
                          Image(uiImage: item.image ?? UIImage())
                              .resizable()
                              .frame(minWidth: (item.image.size.width) / 3, height: (item.image.size.height) / 3)
                              .cornerRadius(20, antialiased: true)
                              .clipShape(Rectangle())
                              .shadow(radius: 10)
  
                          Text(item.name)
                          .color(.primary)
                          .font(.subheadline)
  
                          }
                      }
                      .padding()
                  }
                  }
                  .frame(height: 300)
  
      }
  }
  </code></pre>