iDevelopper / PBRevealViewController

A UIViewController subclass for revealing a left and/or right view controller above or below a main view controller.
MIT License
80 stars 16 forks source link

Slider menu is not working when jump from appDelegate to ViewController #74

Closed ozamihir1990 closed 5 years ago

ozamihir1990 commented 5 years ago

Hello, I am trying to set root view controller from my appDelegate to one ViewController. But it's not working. Here is my code which @iDevelopper has given earlier for different purpose. I already setup my front viewcontroller from storyboard.

SWRevealViewController *revealController = (SWRevealViewController *)self.window.rootViewController; UIStoryboard *storyboard; if ([CommonUtil isiPad]) { storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPad" bundle:nil]; } else { storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; } VC *vc = [storyboard instantiateViewControllerWithIdentifier:@"kLiveMain"]; [revealController pushFrontViewController:vc animated:YES];

@iDevelopper like earlier please help me to resolve this issue also.

Thanks in advance.

iDevelopper commented 5 years ago

Are you using SWRevealViewController or PBRevealViewController. It is ambiguous.

And please, format you code...

ozamihir1990 commented 5 years ago

I am trying to format my code but It's not working. I have not added this line first but after I added now it's working thanks to you for the help. SWRevealViewController *revealController = (SWRevealViewController *)self.window.rootViewController; because I saw @iDevelopper your answer and I tried and it worked.