2

storyboard

I am very new to Swift. I am working on SWRevealViewController in swift 3. My requirement in my project is I have a LoginView Controller. In that, if Login is success means I will get to HomeViewController. In HomeViewController I need SWRevealViewController.

I drag and drop one new Viewcontroller and I named it as SWREvealViewController. Again I drag and drop two View Controllers and One I named it as FrontView and the second one as Menu view. I gave the respective segues to the two view controllers. But for me, I am getting reveal view controller is nil. I tried a lot of scenarios which I found on google and some of the tutorials.

Here is my code which I am trying to navigate to the Next view controller.

     if self.userNameArray.contains(usertextField.text!) && self.passwordArray.contains(passwprdTextField.text!)
                    {
                        print("you have pressed OK button");

                        let view: MenuViewController = self.storyboard?.instantiateViewController(withIdentifier: "MenuViewController") as! MenuViewController
                        let navigationController:UINavigationController = UINavigationController(rootViewController: view)

                         myActivityIndicator.stopAnimating()
                        self.revealViewController().setFront(navigationController, animated: true)

      //self.navigationController?.pushViewController(view, animated: true)
 }
     else
     {

   self.registerAlert();
     }
halfer
  • 18,701
  • 13
  • 79
  • 158
anusha B
  • 23
  • 3
  • 2
    show some code or UI after login to HomeViewController – Anbu.Karthik Jun 04 '18 at 06:34
  • how you are navigating from login to homeviewcontroller . Please post code are you presenting login on top of homeviewcontroller – Vinodh Jun 04 '18 at 06:34
  • Go through this video and try to match your connection https://www.youtube.com/watch?v=i4L69sxj2Ng – Vishal Patel Jun 04 '18 at 06:38
  • is this possible to attach your project here – Anbu.Karthik Jun 04 '18 at 07:35
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Jun 04 '18 at 09:13
  • @VishalPatel I have tried the code for intial view reveal view controller it was working., but if I am trying for the scenario which I mentioned in the above it is not working for that.... – anusha B Jun 04 '18 at 09:39
  • @Anbu.karthik I didn't find any attachment option here. I am sorry to ask like this. I don't know where to attach? – anusha B Jun 04 '18 at 10:03
  • compress your project, and attach here https://www.sendspace.com/, finally i add the link here – Anbu.Karthik Jun 04 '18 at 10:06

0 Answers0