title: How to get correct layout of SwiftUI List Section with header and footer run on iOS 15, but built with iOS 14 SDK?
body: <p>I have been testing my app (built using Xcode 12.5.1, i.e. iOS 14 SDK) on iOS 15 devices, and layout of SwiftUI Section headers and footers is wrong: there is too much bottom padding and not enough top padding on the header, and not enough top padding on the footer.</p>
  <p>When compiled against the iOS 15 SDK (using Xcode 13 beta 5) it appears fine. However, I would like to have my app appear correct for any iOS 15 beta users; I cannot submit an updated built with the iOS 15 SDK until the GM release, so I would like to be able to &quot;fix&quot; this using just the iOS 14 APIs. Is there a good solution, or should I just manually fiddle with paddings?</p>
  <p>Example SwiftUI view:</p>
  <pre class="lang-swift prettyprint-override"><code>struct ContentView: View {
      var body: some View {
          NavigationView {
              List {
                  Section(header: Text(&quot;Header&quot;), footer: Text(&quot;Footer text goes here.&quot;)) {
                      Text(&quot;Cell one&quot;)
                      Text(&quot;Cell two&quot;)
                  }
              }.listStyle(GroupedListStyle())
              .navigationTitle(&quot;Hello Stack Overflow&quot;)
              .navigationBarTitleDisplayMode(.inline)
          }
      }
  }
  </code></pre>
  <p>This produces the following UI:</p>
  <p><a href="https://i.stack.imgur.com/SpImJl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SpImJl.png" alt="Screenshot of app produced with above code" /></a></p>
  <p>The same code built on Xcode 13 and run on the same iOS 15 simulator produces the correct layout:</p>
  <p><a href="https://i.stack.imgur.com/iAfGxl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iAfGxl.png" alt="The same code, built instead of Xcode 13" /></a></p>