title: From collectionView to Detail
body: <p>Im passing data from one <code>CollectionViewController</code> to a detail <code>ViewController</code>. Everything seems to be working, but the <code>"prepareForSegue</code> is happening before the <code>"didSelectItemAtIndexPath"</code> so it's passing the data of the item I selected the last time not the one I'm selecting right now.</p>
  
  <p>This is my <strong>wrong code</strong> for the collectionViewController</p>
  
  <pre><code>var cellSelected : Int = 0
  
  override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
      cellSelected = indexPath.row
      println("Did select!")
  }
  
  override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
  
      if segue.identifier == "identifierName" {
          var secondScene = segue.destinationViewController as detailVC
  
          secondScene.authorDetail = data[cellSelected].userOfImg
          secondScene.likesDetail = data[cellSelected].likesInImg
          secondScene.imageDetail = data[cellSelected].imgPath
          println("Prepare for segue")
      }
  }
  </code></pre>
  
  <p>The result in the debug area is:</p>
  
  <ol>
  <li>Prepare for segue</li>
  <li>Did select!</li>
  </ol>