title: NavigationBar height for SwiftUI's NavigationLink DetailView in Portrait and Landscape
body: <p>Using iOS14.5, Swift5.4, XCode12.5, and SwiftUI,</p>
  <p>I am trying to build simple DetailView to which you can navigate to using a NavigationLink.</p>
  <p>It all works, except that I have no idea about the height of my NavigationBar inside the DetailView. (note that I use the .inline Version by calling <code>.navigationBarTitleDisplayMode(.inline)</code> on the DetailView).</p>
  <p>I am trying to show a simple two-line VStack in the DetailView.</p>
  <p>And it turns out that the DetailView's body is covered by the NavigationBar unless I move the whole thing down by 56 Pixels (by using <code>Spacer().frame(height: 56)</code>).</p>
  <p>And I don't even know the precise height of the NavigationBar
  And even worse, I don't know how to determine it dynamically for Portrait and Landscape rotations.</p>
  <p>How do you make the DetailView's body start below the NavBar no matter rotation-states ?</p>
  <p>Here example Screenshots for Portrait :</p>
  <pre><code>Left side: the title is cut off !           Right side: using a Spacer makes title appear
  </code></pre>
  <p><a href="https://i.stack.imgur.com/dRmuN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dRmuN.png" alt="enter image description here" /></a></p>
  <p>Here is how I open the navigationLink:</p>
  <pre><code>NavigationLink(
      destination: DetailView(session: session).navigationBarTitleDisplayMode(.inline),
      tag: session.id ?? &quot;&quot;,
      selection: $selectedTag,
      label: { EmptyView() }
  )
  </code></pre>
  <p>And here is the entire Detail-Screen:</p>
  <p>(please notice the Spacer-distance of 56 in order to make the title visible at all)</p>
  <pre><code>import SwiftUI
  
  struct DetailView: View {
      
      @State var session: THSession
      
      var body: some View {
          
          VStack(alignment: .leading) {
              
              Spacer().frame(height: 56)   // !!!!!!!!!! without this the title sits behind NavBar !!!!!!!!!!!!!!!!!!!
              
              Text(session.title)
                  .font(.title)
                  .fontWeight(.bold)
                  .foregroundColor(.white)
              
              Spacer().frame(height: 16)
              
              HStack {
                  Text(session.invitationCode)
                      .font(.title)
                      .fontWeight(.bold)
                      .foregroundColor(.white)
              }
              
              Spacer()
          }
          .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .topLeading)
          .background(Color.red)
          .ignoresSafeArea()
      }
  }
  </code></pre>