title: Application crashing with UIApplicationEndBackgroundTaskError
body: <p><strong>Context:</strong> My app is made using SwiftUI, which is a game using SpriteKit.</p>
  
  <p>When pressing the home button on my device, my app encounters an error called '<code>UIApplicationEndBackgroundTaskError</code>'. The log looks like so:</p>
  
  <blockquote>
    <p><code>Can't end BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.</code></p>
  </blockquote>
  
  <p>I have tried making the breakpoint, but it doesn't give me any helpful information I understand. There is no log, it just shows the Debug Navigator.</p>
  
  <p><a href="https://i.stack.imgur.com/Ilp5A.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Ilp5A.png" alt="Debug Navigator"></a></p>
  
  <p>I tried to investigate where the issue came from. I just added some simple print statements. The print <code>Update</code> repeats a few times quickly, before the application is halted by the breakpoint:</p>
  
  <pre><code>struct SceneView: UIViewRepresentable {
  
      let bounds: CGRect
  
  
      // Conformance to UIViewRepresentable
      func makeUIView(context: Context) -&gt; SKView {
          SKView(frame: bounds)
      }
      func updateUIView(_ uiView: SKView, context: Context) {
          print("Update")
  
          let scene = Scene(size: bounds.size)
          uiView.ignoresSiblingOrder = true
          uiView.showsFPS = true
          uiView.showsDrawCount = true
          uiView.showsNodeCount = true
          uiView.presentScene(scene)
      }
  }
  </code></pre>
  
  <hr>
  
  <ul>
  <li>What is causing the issue, and how can I fix this?</li>
  <li>Could this be due to SwiftUI or my Xcode betas and iPhone betas not matching up?</li>
  </ul>