title: Pad the inside of a SwiftUI frame?
body: <p>Is it possible to pad the Left and Right text in this screenshot using SwiftUI? If this were HTML, I would use <code>padding-left</code> and <code>padding-right</code> in CSS. Alas, SwiftUI requires a different way of thinking.</p>
  <p><a href="https://i.stack.imgur.com/tJcmm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tJcmm.png" alt="enter image description here" /></a></p>
  <p>Now that I've got these two nice frames working the way I want them to, what's the technique for shifting that text inside the frame. How can &quot;Left&quot; be scooted slightly to the right moving it away from the left edge and giving it some nice visual space? The same technique can be applied oppositely to the &quot;Right&quot; text.</p>
  <pre><code>GeometryReader { geometry in
    HStack(spacing: 0) {
      Text(&quot;Left&quot;)
        .frame(width: geometry.size.width * 0.33, height: 50, alignment: .leading)
        .background(Color.yellow)
      Text(&quot;Right&quot;)
        .frame(width: geometry.size.width * 0.67, height: 50, alignment: .trailing)
        .background(Color.orange)
    }
  }
  .padding()
  </code></pre>