title: SwiftUI set corner radius depending on its own height
body: <p>When I set corner radius with constant value, depending on the size of the image, the results don't come out the way I want.</p>
  <pre class="lang-swift prettyprint-override"><code>Image(“myImage”)
      .cornerRadius(25)
  </code></pre>
  <p>What I want in app.
  <a href="https://i.stack.imgur.com/DQbEF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DQbEF.png" alt="enter image description here" /></a>
  More clipped in Widget
  <a href="https://i.stack.imgur.com/zYFoB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zYFoB.jpg" alt="enter image description here" /></a>
  So I want to set radius value like  <code>image.size.height / 5</code>, depending on its own size.</p>
  <p>When I think about overlay, code will be like below,</p>
  <pre class="lang-swift prettyprint-override"><code>Image(&quot;myImage&quot;)
  .overlay(
      GeometryReader { geo in
          RoundedRectangle(cornerRadius: geo.size.height / 5)
      }
  )
  </code></pre>
  <p>but when it comes to clipShape to apply corner radius, I don't know how to do.</p>