performSegue(withIdentifier:sender:)
Initiates the segue with the specified identifier from the current view controller’s storyboard file.
Declaration
func performSegue(withIdentifier identifier: String, sender: Any?)Parameters
- identifier:
The string that identifies the triggered segue. In Interface Builder, you specify the segue’s identifier string in the attributes inspector.
This method throws an TP40008195 CH18 if there is no segue with the specified identifier.
- sender:
The object that you want to use to initiate the segue. This object is made available for informational purposes during the actual segue.
Discussion
Normally, segues are initiated automatically and not using this method. However, you can use this method in cases where the segue could not be configured in your storyboard file. For example, you might call it from a custom action handler used in response to shake or accelerometer events.
The current view controller must have been loaded from a storyboard. If its storyboard property is nil, perhaps because you allocated and initialized the view controller yourself, this method throws an exception.