0

Hello I am new to IOS and I have difficulty with some issues. I am using SWRevealViewController and I need to log in and logout from it.

I switch between login screen and main screen in AppDelegate

BOOL isLoggedIn = [[NSUserDefaults standardUserDefaults] objectForKey:@"islogin"];
NSString *storyboardId = isLoggedIn ? @"login_screen" : @"main_screen";
self.window.rootViewController = [self.window.rootViewController.storyboard instantiateViewControllerWithIdentifier:storyboardId];

In Login view controller (I have uses show details Segue)

[self performSegueWithIdentifier:@"login" sender:self];

In Right Reveal Menu with logout TableViewCell selected (also with show detail segue)

[self performSegueWithIdentifier:@"logout" sender:self];

My question that if the user login and logout multiple times will ViewControllers go to back stack and allocate memory.

I have used show detail segue since I thought it will replace the previous view controller and what about front view controller?

Am I in the right way? please help

mmrayyan
  • 53
  • 1
  • 5
  • SWReveal View Controller has no logout function ,you need to manually handle your details if you are used push you need to pop , else if you are used modal/present you need to dismissyourViewcontroller – Anbu.Karthik Sep 30 '15 at 09:40
  • is there slide menu library with logout function – mmrayyan Sep 30 '15 at 11:25

1 Answers1

0

You can use MSDynamicsDrawerViewController for logout functionality. You can also use SWRevealViewController, then you need to manually add the functionality of logout, because SWRevealController can not provide the logout functionality. Check this demo how to use SWRevealController in Swift, if you are using Swift.

yo2bh
  • 1,356
  • 1
  • 14
  • 26