John-Lluch / SWRevealViewController

A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right !
Other
4.52k stars 989 forks source link

Navigation from UIViewController to SWRevealViewController sw_front #513

Open NuelNikhil opened 8 years ago

NuelNikhil commented 8 years ago

I am using SWRevealViewController in my new app. I have some troubles now using SWRevealViewController. my issue is , I have followed this tutorial for using SWRevealViewController . I have a login screen with a Sign in button and a Home ViewController where a user sign in from LoginViewController and reaches.At first I just created a push segue from sign in button to the HomeViewController(StoryBoard Segue identifier set to sw_front). Later I was in need to use an Api to make requests. so when a user enters his email and password and then he taps the sign in button , this time i need to make a request to the Api to check if the user exists, if the user exists then let him navigate to his HomeViewController. In my HomeViewController(sw_front) i can just swipe from right to left or tap on a Hamburger menu icon to display menu details(MenuViewController StoryBoard Segue identifier set to sw_rear). and to the issue I am facing, if I set a Push segue i am able to make the swipe or menu button tap to reveal the MenuViewController(sw_rear) .but if I make the navigation from LoginViewController to HomeViewController through code i a not able to perform the swipe or menu button tap i can tap but its not showing the MenuViewController(sw_rear)

Code I used to navigate

 let _storyBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
 let _homeViewController = _storyBoard.instantiateViewControllerWithIdentifier("HomeViewController") as! HomeViewController
 self.navigationController?.pushViewController(_homeViewController, animated: true)

My Question is How to navigate through code from UIViewController to SWRevealViewController with identifier sw_front with SWRevealViewController working ??

iDevelopper commented 8 years ago

516 should help you