-1

I learn Swift by myself. I know how to perform a segue from a tableView because it's "clickable" Cells.

My question is :

I have a Collection view composed of UIImages. UIImages not "clickable", I placed on TapGesture.

How do I perform segue from those TapGestureRecognizer to a detailViewController.

Please help me (IndexPath?, DidSelectItemAtIndexPath?...) which func must I use ?

PS: Sorry for my bad English

Quentin F.
  • 17
  • 2

2 Answers2

0

Maybe you could use a UIButton over your Image !

0

From my experience, I have used:

    func collectionView(collectionView: UICollectionView,didSelectItemAtIndexPath indexPath: NSIndexPath) {
    name = UIImage(named: array[indexPath.row])

You are going to have to identify "name" variable in the beginning of your code such as:

    var name : AnyObject? {
    get {
    return NSUserDefaults.standardUserDefaults().objectForKey("name")
    }
    set {
    NSUserDefaults.standardUserDefaults().setObject(newValue!, forKey: "name")
    NSUserDefaults.standardUserDefaults().synchronize()
    }
    }

Hope this helps!

Chosen
  • 1
  • 6