title: Swift 3 Trying to pass audio path/audio file, to audio player VC
body: <p>I am new to swift and programming in general. When a cell is pressed I want to segue into a audio player view and play selected audio. For now i only got one audio playing, it doesn't matter what cell is selected. Any help would be appreciated, thanks in advance.</p>
  
  <pre><code>class TableViewController: UITableViewController {
      var audioPlayer:AVAudioPlayer = AVAudioPlayer()
      var pictures = ["AlbertEinstein.jpg","dreamBig.jpg", "LionFearless.jpg", "MLK.jpg"]
      var names = ["Einstein", "DreamBig", "LionFearless", "MartinLutherKing",]
  
      let audioPath = Bundle.main.path(forResource: "Music", ofType: "mp3")
      let newAudioPath = Bundle.main.path(forResource: "AchievingAnythingYouWant", ofType: "m4a")
  
      override func numberOfSections(in tableView: UITableView) -&gt; Int {
          return 1
      }
  
      override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return names.count
      }
  
      override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! TableViewCell
  
          cell.tittleLabel!.text = names[indexPath.row]
          cell.pictureImage.image = UIImage(named: pictures[indexPath.row])
  
          return cell
      }
  
      override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
          if segue.identifier == "showDetail" {
              let detailVC = segue.destination as! PlayerViewController
              let myIndexPath = self.tableView.indexPathForSelectedRow!
  
              //path to audio file
              let row = newAudioPath
              detailVC.sendData1 = row!
  
              let row2 = audioPath
              //variable in deatilVC to hold audio
              detailVC.sendData2 = row2!
          }
      }
  }
  </code></pre>