0

I have already implemented JASidePanelController with storyboards way in a project and it works fine. I have a Storyboard like this:

[NavigationController] -> [MySidePanelControllerViewController]   [LoginVC] -> [HomeVC] -> [ListVC] -> [DescriptionVC]

And the swipe menu is in LoginVC that has Storyboard's ID centrerViewController.

Now I would like to have the swipe menu only in ListVC. How can I do that?

If I give Stroryboard ID centrerViewController to ListVC the application starts at ListVC, not at loginVC.

Shaik Riyaz
  • 11,204
  • 7
  • 53
  • 70
Tenaciousd93
  • 3,438
  • 4
  • 33
  • 56
  • I guess when you open the application you first want user to log in before going through swipe menu? – Retro Dec 27 '13 at 10:49
  • Yes, the swipe menu must be hidden within the listVC, now I'm reading about allowLeftSwipe and allowRightSwipe [here](https://github.com/gotosleep/JASidePanels/pull/36). I try to make an istance of `MySidePanelControllerViewController` in the loginVC and set it to no, like that:`MySidePanelControllerViewController *m = [[MySidePanelControllerViewController alloc]init]; [m setAllowRightSwipe:NO]; [m setAllowLeftSwipe:NO];`. But it seems it doesn't work :( – Tenaciousd93 Dec 27 '13 at 10:54

1 Answers1

0

I have done the same thing but using MFSideMenuContainerViewController

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    MFSideMenuContainerViewController *container = [MFSideMenuContainerViewController
                                                        containerWithCenterViewController:_rootNavController
                                                        leftMenuViewController:settingDrawerController
                                                        rightMenuViewController:nil];
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [self.window makeKeyAndVisible];
    [self.window setRootViewController:container];
}

and I have set my controller at application delegate and present the loginViewContrller as model view from

- (void)applicationDidBecomeActive:(UIApplication *)application {

        [self showLoginView];
 }





- (void)showLoginView
{
    UIViewController *topViewController = [self.navController topViewController];
    if (![topViewController isKindOfClass:[LGLoginViewController class]]) {
        [self.navController popToRootViewControllerAnimated:YES];
        self.navController = nil;

        LGLoginViewController* loginView = [[LGLoginViewController alloc] initWithNibName:@"LGLoginViewController"bundle:nil];

        if (!self.navController) {
            self.navController = [[UINavigationController alloc] initWithRootViewController:loginView];
        } else {
            [self.navController initWithRootViewController:loginView];
        }

        self.navController.delegate = self;
        [self.window.rootViewController presentModalViewController:self.navController animated:NO];
    }
}
Retro
  • 3,985
  • 2
  • 17
  • 41
  • I guess I haven't understood: with this code you set the swipe menu after the login? Is `_rootNavController` my central vc? What is `self.navController`? last question: `container` is not used: should I add `self.window.rootViewController = container; [self.window makeKeyAndVisible];` to `- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions`? – Tenaciousd93 Dec 30 '13 at 07:43
  • Yes, I have updated my answer and I am loading the swipe controller first but not showing until user not get validated – Retro Dec 30 '13 at 07:49
  • ok, now I understand. But if I would like to have only in one vc? In my situation I have [this scenario](http://s29.postimg.org/4pimqcncn/Schermata_2014_12_30_alle_09_17_56.png). PS: `self.navController` is a UINavigationController? thanks – Tenaciousd93 Dec 30 '13 at 08:19
  • Yes, its navigation controller. Only one vc? I think as a root view you can only have the container and for login and home view you can achieve through model view controller. Best possible I guess – Retro Dec 30 '13 at 09:05