title: How to stop multiple AVAudioPlayers from playing in swift?
body: <p>I am very new to swift and I was a novice with Objective-C. Recently I started a soundboard app that plays many sounds on 3 different view controllers. For the apps next update I wanted to make it so it could play multiple sounds simultaneously and I did this by creating an individual audioPlayer for each button. So for each view controllers I would have 9 instances of AVAudioPlayers (One for each button) and when each button was pressed it would play one of them EX: audioPlayer8 would belong to the hitmarkerButton. I succesfully did this but now I want a way for the users to press a button to "reset" the sounds in the app. So for each view controller I already created an IBAction called stopPlayingSounds that should "reset" or stop playing all sounds from all view controllers. This is my first time asking a question here so please tell me if there is anything else I should include. Thank you.</p>
  
  <p>Also each of the examples included below are just one of up to 9 examples for each view controller. PS - Each view controller is a page.</p>
  
  <p>The "Sound Stopper" Button:</p>
  
  <pre><code>    @IBAction func stopPlayingSounds(sender: AnyObject) {
  
      }
  </code></pre>
  
  <p>An example of one of the buttons:</p>
  
  <pre><code>    @IBAction func hitmarkerButton(sender: AnyObject) {
      audioPlayer8 = AVAudioPlayer(contentsOfURL: hitmarkerSound, error: nil)
      audioPlayer8.prepareToPlay()
      audioPlayer8.play()
  }
  </code></pre>
  
  <p>Example of one of the declarations of the AVAudioPlayers:</p>
  
  <pre><code>var audioPlayer8 = AVAudioPlayer()
  </code></pre>
  
  <p>And lastly, an example of the creation of the actual sound:</p>
  
  <pre><code>    var hitmarkerSound = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("hitmarker", ofType: "mp3")!)
  </code></pre>