title: How can I add a custom container view in SwiftUI
body: <p>I'm curious if you can create a custom container view within SwiftUI. I know that you can create custom content views, such as <code>Text()</code>, but wasn't sure if you could replicate the functionality of say <code>HStack { }</code></p>
  
  <p>Something akin to:</p>
  
  <pre class="lang-swift prettyprint-override"><code>HGrid {
      Text("Lorem ipsum")
      Text("Lorem ipsum")
  }
  </code></pre>
  
  <p>Where the custom container view (aka <code>HGrid</code>) would then, say, add <code>Spacer()</code> between each added component. Essentially, as an example, transpiling it to:</p>
  
  <pre class="lang-swift prettyprint-override"><code>HStack {
      Text("Lorem ipsum")
      Spacer()
      Text("Lorem ipsum")
  }
  </code></pre>