Preparing your view controller before a triggering a Segue
suggest changePrepareForSegue:
func prepareForSegue(_ segue:UIStoryboardSegue, sender sender:AnyObject?)
Notifies the view controller that a segue is about to be performed
Parameters
segue: The segue object.
sender: The object that initialized the segue.
Example in Swift
Perform a task if the identifier of the segue is “SomeSpecificIdentifier”
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "SomeSpecificIdentifier" {
//- Do specific task
}
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents