App login issue using SWRevealViewController

2019-08-04 16:07发布

问题:

My App having sideMenu like facebook so i can implement that using SWRevealViewController (Storyboards)library.It was working fine.I got one issue.

Let me explain my situation.

My app has a login view. If the login informations are ok then i can saved the user information in NSUserdefaults.From next time onwards the user directly moves to HomeViewController(not login required).My homeviewController is TabbarController.I can implement this using storyboards(SWRevealViewController).I'm stuck here .So can one give me some guidance how to implement this? I'm new to storyboards

In Appdelegate.m file:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

  NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
       if ([defaults valueForKey:@"USERID"]) {

        SidebarViewController *rearViewController = [[SidebarViewController alloc] init];

        RootTabViewController *frontViewController = [[RootTabViewController alloc] init];

        SWRevealViewController *mainRevealController =
                                        [[SWRevealViewController alloc] initWithRearViewController:rearViewController frontViewController:frontViewController];

           self.window.rootViewController = mainRevealController;

        }
        return YES;

}

This is my storyboard: