title: Play specific sound when specific button is pressed in iOS
body: <p>I'm a beginner in iOS development and I am trying to make a simple app which plays specific sounds when a specific button is pressed with two segmented control for options (as shown in the image below). I have looked up many tutorials on YouTube, stack and other websites, but all of them seem to either give me a lot of errors or are too hard for me too understand (as I am too unexperienced).</p>
  
  <p>Some of my attempts, but this work for 1 button and 1 sound only.</p>
  
  <pre><code>import UIKit
  import AVFoundation
  
  class ViewController: UIViewController {
      // make sure to add this sound to your project
      var pianoSound = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("C", ofType: "m4a"))
      var audioPlayer = AVAudioPlayer()
  
      override func viewDidLoad() {
          super.viewDidLoad()
          audioPlayer = AVAudioPlayer(contentsOfURL: pianoSound, error: nil)
          audioPlayer.prepareToPlay()
      }
  
      @IBAction func PianoC(sender: AnyObject) {
          audioPlayer.play()
      }
  }
  </code></pre>
  
  <h2>Please, can someone show me how to make this app, as shown in the image below?</h2>
  
  <h2><a href="https://imgur.com/tWgCDWD" rel="nofollow noreferrer">http://imgur.com/tWgCDWD</a></h2>
  
  <p>Required: there are three buttons ( cat, dog, bird ) , every button have own sound. and the first segmented ( sound ) for enable or disable the sound, eg. when user choose sound off option there will be no sound even the button clicked, and the second segmented for enable or disable the music on the background .</p>