Should we avoid dragging the segue loop between the two views?

Well, for some of you this may seem ridiculous, but I am discussing with my comrades about the design of the ios application, and I need your opinion on this.

The old design, which I do not agree, is the following

  • We have a ViewControllerA that contains the "Go to B" button. The button has a PUSH segue to go to B.
  • We have a ViewControllerB that contains a "Go To A" button. The button has a PUSH segue to go to A.
  • We need to travel a lot between 2 ViewController.

As you can see, there is a segue loop between ViewController A and B, and I think we should never let this happen. I would rather go from B to A using the back button on the navigation bar.

How serious is the PUSH segue loop in design? In some cases, is this acceptable? Where can I see the recommended good apple design (if any?)

EDIT: I am trying to do "pop before push" nfarshchi, but this does not work. Here's how I did it: 1) I cannot create a segue from VC A to VC B and switch from VC B to VC A at the same time. The storyboard seems to prevent this from happening 2) So I create one segment whose identifier is "gotoB" from the "Go to B" button in VC A to VC B and one segment whose identifier is "gotoA" from the button Go to A in VC B to VC A.

So the storyboard will look like this:

VC X --- Push --- > VC A < ---- Push ---- > VC B (, ViewController X, ) 3) VC A :

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    NSLog(@"Prepage for segue go to B") ;
    if ([[segue identifier] isEqualToString:@"gotoB"] ) {
        [self.navigationController popViewControllerAnimated:NO];

    }
}

VC X, ViewController Stack, ViewController.

, " B" , VC X. , popViewControllerAnimated: VC A, , VC B . VC B Stack, .

, nfarshchi

+5
2

, , UIViewController , . , UINavigationController. , .

+3

push/pop , 2D-, , . 10 , , , , .

"" , , , . , .

+1

All Articles