When I change my uitableview to edit mode, i'd like the user to be able to select a cell without the segue taking place. The segue was linked in the storyboard. Is there a way to disable the segue during edit mode?
I can't disable interaction with the cell during edit more because I need to pick up on the editing control (insert button) press.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With