self..window.rootViewController.performSegueWithIdentifier("nameOfSegueInStoryboard", sender: self)
This will transition to a view controller of your choice. To change variables in that view controller, you can use the prepareForSegue
method under the view controller that contains the collection view:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "nameOfSegueInStoryboard" {
let controller = segue.destinationViewController as! NameOfYourViewController
controller.variable_name = new_value
}
}
This all relies on you adding a segue from your first view controller to the other and giving it an identifier in your storyboard.