John-Lluch / SWRevealViewController

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

How to show different frontviewcontroller based on condition while login ? #715

Open Iniyarajan opened 7 years ago

Iniyarajan commented 7 years ago

I used a SWRevealViewController with front and rear and it works great. Now I need to switch between front view controller based on login condition(I need to show admin and messenger based on condition as front).kindly help me to implement the same. screen shot 2017-07-31 at 8 41 32 pm

iDevelopper commented 7 years ago

To change the front view controller, use revealviewcontroller setFontViewController

lucasacw commented 7 years ago

I was able to do it with this code:

let storyboard = UIStoryboard(name: "Main", bundle: nil) let logInViewController = storyboard.instantiateViewController(withIdentifier: "logInVC") self.revealViewController().setFront(logInViewController, animated: true)