0

I have used revealviewcontroller in which I take a view controller and set its sw_front to a tabbar controller and sw_rear to tableview controller. when I am running , its working fine . In tabbar controller I have added 5 different view controllers and same items in tableview cells also dynamically in sw_rear part. In table view for each cell i have connected the dynamic cells to its related view controller based on its indexpath.row . But when i click on it the tabbar items is not coming . the navigation items are coming because before every view controller i have embed the navigation controller. why the tabbar items are not coming???

For better understanding I am sending few codes and screens

codes

I have set the tableview like this for each dynamic cell

switch(indexPath.row)
    {
    case 0 :
        print("1st row")
       //self.performSegueWithIdentifier("segueIdentifier", sender: self)
        let mainStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
        let vc : UINavigationController = mainStoryboard.instantiateViewControllerWithIdentifier("homeVC") as! UINavigationController
        self.presentViewController(vc, animated: true, completion: nil)

        case 1 :
        print("2nd row")
        let mainStoryboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle())
        let vc : UINavigationController = mainStoryboard.instantiateViewControllerWithIdentifier("menuVC") as! UINavigationController
        self.presentViewController(vc, animated: true, completion: nil)

But when i click on ,it goes to view controller but tabbar items not coming

screens

enter image description here

This screen is the first view .Here you can see the tabor items are coming .Now clicking on slide menu the screen is

enter image description here

the dynamic data is coming . now clicking on for example home the screen shows like this enter image description here

here no tabbar items are there and the sliding menu button is not working . where i am doing mistake??

Below is the code for setting reveal view controller on slide menu button:

 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())
    }


}
PRADIP KUMAR
  • 489
  • 1
  • 9
  • 31

1 Answers1

0

You should go back to using performSegueWithIdentifier instead of instantiateViewControllerWithIdentifier, since you have custom segues. Use didSelectRowAtIndexPath method for choosing segue. Read this tutorial for setting up segues and nav/tabbar controllers properly

Yury
  • 6,044
  • 3
  • 19
  • 41
  • that way also i have tried .you can see that in coding i have make it a comment ,bcoz its not working – PRADIP KUMAR Jun 29 '16 at 10:20
  • And how can i create segue with dynamic cells. if the cell is static its possible to create segue but in dynamic i have no idea – PRADIP KUMAR Jun 29 '16 at 10:28
  • @PRADIPKUMAR answer corrected. Your question is too wide, so main answer idea still read more documentation – Yury Jun 29 '16 at 11:50
  • I can understand . the link you have sent I saw. Actually my table viewdata is not static that i can create segue for each view controller . here the number of tableview cells and its data are dynamically coming – PRADIP KUMAR Jun 29 '16 at 12:24
  • @PRADIPKUMAR as I see on screenshot - you can add segue for every possible case. Or you can make one segue to empty controller and then customize it as you wish in prepareForSegue. – Yury Jun 29 '16 at 12:30