iOS Segues Deciding if an invoked Segue should be performed.



 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