Inside my unwind action method for my unwind segue, I send data to a remote database, and it verifies if the information was successfully stored in the database.
I plan on having my verification function return a 0 or 1, for success or failure, and I'm planning on using that as the condition.
I'm curious if there is a way to abort the unwind segue inside of the unwind action method? (Or should I just do this verification before the unwind segue begins and prevent the unwind segue from even beginning somehow?)
I've already read ios segue "cancel" but I don't know what they mean when they say to override the
-[UIViewController shouldPerformSegueWithIdentifier:sender:]
method. Do I just make my own custom version of this method (see below) and call it inside the unwind action method, and make it return no/yes depending on my condition? I tried overriding the method with:
- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender {
if (database verification fails) {
return NO;
}
return YES;
}
and I called it inside my unwind action method, however it didn't cancel the unwind segue.
Am I doing something incorrectly, or is there another way to abort the unwind segue inside the unwind action method?
I am new to iOS, so I'm sorry if this question sounds silly. Thanks for any help!