title: SwiftUI: Can't align image to the top of ZStack
body: <p>I can't figure out how to align <code>Image</code> view on top of <code>ZStack</code>, by default views in SwiftUI are placed at the center of their parent, and we then use stacks to align them, I have the following piece of code:</p>
  <pre><code>struct ContentView: View {
      var body: some View {
          ZStack {
             Image(&quot;bgImage&quot;)
             Text(&quot;Hello, World!&quot;)
          }
      .frame(maxWidth: .infinity, maxHeight: .infinity)
          .background(Color.red) //this is for debugging purposes, to show the area of the ZStack
      }
  }
  </code></pre>
  <p>How can I position the image to the top ?</p>
  <p><img src="https://i.stack.imgur.com/P0HpR.png" width="300"></p>