1
votes

I have two storyboards:

  1. Login / register purposes (without navigation view controller)
  2. Main storyboard (with navigation view controller)

When I hit Logout button (navigation bar item) on Main storyboard I am redirected to Login storyboard, but still see the navigation bar. How can I do this segue an also leave navigation view controller, so that navigation bar will not be visible ?

2
Which type does the segue have?Andrey Gershengoren
If possible post a screenshot of your storyboard.Bista

2 Answers

0
votes

Here what you can do,

When you want to show a Login controller without navigation bar, use

        UIStoryboard * board = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        LoginCntrl * cntrl = [board instantiateViewControllerWithIdentifier:@"LoginCntrl"];
        [self presentViewController:LoginCntrl animated:YES completion:^{

    }];

Here 'LoginCntrl' in instantiateViewControllerWithIdentifier method is, the identifier of the LoginCntrl specified in storyboard. Because presentViewController is not part of the navigation controller, this won't show you navigation bar at the top.

0
votes

On logout event, change the rootViewController of window,

1) Create object of appDelegate 2) Create object of LoginVC

appDelegateObject.window?.rootViewController = objectOfLoginViewController;