I have problem with this code:
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
self.performSegue
Try this:
let cell = sender as StampsCollectionViewCell
let indexPath = self.collectionView!.indexPathForCell(cell)
And your code will be:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?)
{
if segue.identifier == "showDetailsSegue" {
let detailsVC: DetailsViewController = segue.destinationViewController as! DetailsViewController
let cell = sender as StampsCollectionViewCell
let indexPath = self.collectionView!.indexPathForCell(cell)
var thisCoupon = self.userCoupons[indexPath.row] as UserCoupons
detailsVC.userCoupon = thisCoupon
detailsVC.pinArray = self.pinArray
detailsVC.userStamp = self.userStamps[indexPath.row]
}
}
Hope it will work.