SWRevealViewController is getting nil after returning back through segue?
<p>In loginVC i have created a button on clicking it, it goes to main tabbarcontroller thru segue like this..</p>

<pre><code>@IBAction func btnLoginPressed(sender: AnyObject) {
 self.performSegueWithIdentifier("logintoMain", sender: self)    
}
</code></pre>

<p>is succesfully goes to tabbarmainVC but after that the swRevealviewController is getting nil.. and the sliding not working here. why?</p>

<pre><code>class MaintabbarController: UIViewController{

@IBOutlet weak var slideBtn: UIBarButtonItem!

override func viewDidLoad() {
    super.viewDidLoad()

    // Do any additional setup after loading the view.
    if self.revealViewController() != nil{
        slideBtn.target = self.revealViewController()
        slideBtn.action = #selector(SWRevealViewController.revealToggle(_:))
        self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
    }    
}
</code></pre>

<p><strong>Edited</strong></p>

<p>I have tried this code also on login button click to go to the mainTabbarvc. Now its working fine . Actually i have to push the revealviewController than only it will be active..</p>

<pre><code> @IBAction func btnLoginPressed(sender: AnyObject) {
  let sb = UIStoryboard(name: "Main", bundle: nil)
  let vc =sb.instantiateViewControllerWithIdentifier("yourtabbarvcidentifier") as! UITabBarController
   vc.selectedIndex = 0
 // self.presentViewController(vc, animated: true, completion: nil)
    self.revealViewController().pushFrontViewController(vc, animated: true)
  }
</code></pre>