title: Have SwiftUI ProgressView show for 1 second before real content shows
body: <p>I have a function in my SwiftUI app that waits 0.5 seconds for all of the data to come in and then rearranges the order of a list based on that data. This eventually works, but it makes for some weird jumping around for the first second or so of the list order because it is being changed after 0.5 seconds. The code looks like this:</p>
  <pre><code>DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
                  
      self.restaurants.sort {
          let waitTime1 = self.waitTimes[$0.id!] ?? -1
          let waitTime2 = self.waitTimes[$1.id!] ?? -1
          if (waitTime1 &gt;= 0 &amp;&amp; waitTime2 &lt; 0) {
              return true
          } else if (waitTime1 &lt; 0 &amp;&amp; waitTime2 &gt;= 0) {
              return false
          } else if (waitTime1 &gt;= 0 &amp;&amp; waitTime2 &gt;= 0) {
              return waitTime1 &lt; waitTime2
          } else if (waitTime1 &lt; 0 &amp;&amp; waitTime2 &lt; 0) {
              return false
          } else {
              return false
          }         
      }
  }
  </code></pre>
  <p>Essentially, I need wait 0.5 seconds for the <code>self.waitTimes</code> data to come in or else the list will sort with out it. I want to try to show a <code>ProgressView</code> over the regular content view while this sorting is taking place, for about a second. I tried putting all my content in a separate content view and then setting it equal to a <code>ProgressView</code> for a second then setting it back to the original content, but this didn't work:</p>
  <pre><code>contents = AnyView(ProgressView())
               
  DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
      contents = AnyView(origContents)
                   
      self.restaurants.sort {
          let waitTime1 = self.waitTimes[$0.id!] ?? -1
          let waitTime2 = self.waitTimes[$1.id!] ?? -1
          if (waitTime1 &gt;= 0 &amp;&amp; waitTime2 &lt; 0) {
              return true
          } else if (waitTime1 &lt; 0 &amp;&amp; waitTime2 &gt;= 0) {
              return false
          } else if (waitTime1 &gt;= 0 &amp;&amp; waitTime2 &gt;= 0) {
              return waitTime1 &lt; waitTime2
          } else if (waitTime1 &lt; 0 &amp;&amp; waitTime2 &lt; 0) {
              return false
          } else {
              return false
          }
                                      
     }
  }
  </code></pre>
  <p>Does anyone have any suggestions for how I can have the <code>ProgressView</code> be displayed for a second while my list gets sorted? Thank you</p>