When using the Navigation Controller connected two View Controller via the "Login" button on the principle of Show (Push).

When pressed, a transition is triggered, it works, but a transition is needed only when the condition is met. For understanding, for example, only if the authorization was successful.

    1 answer 1

    You can implement this through Storyboard ID , if it is registered, you can create a condition

    enter image description here

     if (условие) { //Контроллер в которому нужно перейти. CategoryController * detail = [self.storyboard instantiateViewControllerWithIdentifier:@"CategoryController"]; [self.navigationController pushViewController:detail animated:YES]; } 
    • And where is this condition prescribed? I tried to write in ViewController.m in the action of this button, but there the Storyboard ID of the second screen does not know, in the end I can not declare * detail - StriBog
    • one
      Storyboard ID registered in the controller controller's main.storyboard where you need to go, in ViewController you import the controller where you need to go, for example #import "CategoryController.h" - Victor Mishustin