Calling Drawer after Login?
haleyngonadi opened this issue · 2 comments
haleyngonadi commented
I'm having an issue calling this in a presentviewcontroller. I want the main view to resume after a user logs in but nothing happens:
SideViewController *about = [AppDelegate globalDelegate].drawerViewController;
[self presentViewController:about animated:YES completion:nil];
SideViewController being a subclass of JVFloatingDrawerViewController!
dengpengks commented
you should register a notification, post a notification when you login.
carloskekwa commented
on LoginViewController :
AppDelegate *delegate = [AppDelegate globalDelegate];
[delegate InitDrawer];
in Appdelegate.m
// make the app enter the MainPage.
- (void)InitDrawer
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = self.drawerViewController;
[self configureDrawerViewController];
[self.window makeKeyAndVisible];
}
- (void)configureDrawerViewController {
if ([[UtileFile getLanguagePhone] containsString:@"ar"]){
self.drawerViewController.rightViewController = self.rightDrawerViewController;
self.drawerViewController.centerViewController = self.drawerSettingsViewController;
self.drawerViewController.animator = self.drawerAnimator;
self.drawerViewController.backgroundImage = [UIImage imageNamed:@"drawerimg"];
}else{
self.drawerViewController.leftViewController = self.leftDrawerViewController;
self.drawerViewController.centerViewController = self.drawerSettingsViewController;
self.drawerViewController.animator = self.drawerAnimator;
self.drawerViewController.backgroundImage = [UIImage imageNamed:@"drawerimg"];
}
}
- (UITableViewController *)rightDrawerViewController {
if (!_rightDrawerViewController) {
_rightDrawerViewController = [self.drawersStoryboard instantiateViewControllerWithIdentifier:kJVRightDrawerStoryboardID];
}
return _rightDrawerViewController;
}