Deciding if an invoked Segue should be performed.

suggest change


func shouldPerformSegueWithIdentifier(_ identifier:String, sender sender:AnyObject?) -> Bool
Determines whether the segue with the specified identifier should be performed.


Identifier: String that identifies the triggered segue

Sender: The object that initialized the segue.

Example in Swift

Only perform segue if the identifier is ‚ÄúSomeSpecificIdentifier‚ÄĚ

override func shouldPerformSegueWithIdentifier(identifier:String, sender:AnyObject?) -> Bool {
    if identifier == "SomeSpecificIdentifier" {
        return true
    return false

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents