Discard segue during uitableview editing mode
In your view controller, override:
- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender{
return !self.isEditing;
}
Inside that method check if this is the correct segue, and verify the edit state. If the editing is on, return NO
; otherwise, return YES
.
Swift 3+:
Assuming you've inherited from UITableViewController:
override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool {
return !tableView.isEditing
}
Note this will disable all segues while editing. If you have more than one and you want some to remain enabled in edit mode, apply the appropriate logic within this function to return true or false as appropriate.