title: How to combine shapes in SwiftUI?
body: <p>I need to create a shape from several other shapes, and ideally, I'd get a single shape struct at the end which would have two shapes stacked as ZStack would. I haven't noticed an obvious implementation of this anywhere, so maybe somebody has some ideas on how to implement it?</p>
  
  <p>Here's what I want to have:</p>
  
  <pre class="lang-swift prettyprint-override"><code>struct CustomShape: Shape {
      func path(in rect: CGRect) -&gt; Path {
          // Add shapes here???? For example, combine Rectangle with Circle?
      }
  }
  </code></pre>