I have a navigation based app that requires a passcode to view some pages. When I am on Controller A I want to push to the Passcode Controller then push to Controller B and remove the Passcode Controller from the stack.
So to be clear, Passcode Controller is stuck in between Controller A and Controller B and I do not know how to remove it.
I've tried two different approaches but neither is giving me the right result.
Attempt 1:
ControllerB *contB = [self.storyboard instantiateViewControllerWithIdentifier:@"contB"];
[self.navigationController pushViewController:contB animated:YES];
[self.navigationController popViewControllerAnimated:NO];
Attempt 2:
ControllerB *contB = [self.storyboard instantiateViewControllerWithIdentifier:@"contB"];
ControllerA *contA = [self.storyboard instantiateViewControllerWithIdentifier:@"contA"];
[UIView transitionFromView:contA.view
toView:contB.view
duration:0.65f
options:(UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionTransitionCrossDissolve)
completion:^(BOOL finished){
self.view.window.rootViewController = contA;
}];
Does anyone know how I can remove Passcode Controller from the stack whenever I push Controller B from the Passcode Controller?