Step by step:
prepareForSegue(_:sender:)
.segue.identifier
equals the identifier you specified in step 1.segue.destinationViewController
to your property from step 2.viewDidLoad()
method already.Example:
var containerViewController: YourContainerViewControllerClass?
let containerSegueName = "testSegue"
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == containerSegueName {
containerViewController = segue.destinationViewController as? YourContainerViewControllerClass
}
}