title: In Swift, How can I make music keep playing while user is using my app? (swiftUI)
body: <p>When a user taps the button, it plays the music, and then it stops background music playing. But what I want is background music to keep playing even after the user had tapped the button</p>
  
  <p>Here is code for playing the music</p>
  
  <pre><code>@State var bombSoundEffect: AVAudioPlayer?
  
  
  
  
  Button("Button") {
   let path = Bundle.main.path(forResource: "example.mp3", ofType:nil)!
              let url = URL(fileURLWithPath: path)
  
  
          do {
              self.bombSoundEffect = try AVAudioPlayer(contentsOf: url)
              self.bombSoundEffect?.play()
          } catch {
              // couldn't load file :(
          }
  
  }
  </code></pre>
  
  <p>How can I make background music keep playing even after user taps this button?</p>