ios - Segue in UICollectoinView using Xcode 6 -
I'm new to Swift and iOS development. I'm trying to prepare a demo app that shows the details of an item in a new scene when clicked. I tried to use the storyboard but I found out that no one can create segments directly from SEZ in the storyboard because collection view
is dynamically populated through the data source.
So I did not trigger anything by clicking PerformSegueWithIdentifier: sender
but I click on an item I have set the identifier for Segue in the storyboard. I do not know what is wrong (as I am very new and still do not understand the full flow).
My first class is myFirstViewController.swift
and second mySecondViewController.swift
please ( prepareForSegue , showSegue function < / Strong> should be kept where?) I am using xCode 6 OS X Yosemite .
Your myFirstViewController
class UICollectionViewDelegate
protocol implemented Have to do.
Create a segue to your second view controller by ctrl-dragging from the viewcontroller1 icon in another view controller. Enter an identifier name in that property inspector. In
myFirstViewController.swift
, implement the collectionView (_: didSelectItemAtIndexPath :)
, you can call it with the identifier name of your Segue Do performSegueWithIdentifier
.
Comments
Post a Comment