title: Swift: Array of audio files
body: <p>Using Swift 2 how would I create an array of audio files to be used on a collection view? </p>
  
  <p>There are 4 options "Ocean", "Birds", "Nature", "Waves" and they are displayed as cells.</p>
  
  <p>When a cell is clicked, I need it to play the sound. Can you please help?</p>
  
  <pre><code>    var imageArray = [UIImage(named: "ocean"),UIImage(named: "birds"),UIImage(named: "nature"),UIImage(named: "wave")]
  var nameArray = ["Ocean","Birds","Nature","Waves"]
  
  
  
  func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
      return self.imageArray.count
  }
  
  func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -&gt; UICollectionViewCell {
      let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! homeCollectionViewCell
  
      cell.iconImage?.image = imageArray[indexPath.item!]
      cell.label.text = nameArray[indexPath.item!]
  
      return cell
  }
  </code></pre>