0
votes

i have been looking for an answer, can someone please guide me as i have a TabBar Controller with a tableview, Now the scenario is, if the user is not logged in and click on any row then a view controller with a clear color is presented with a small view having a UIButton. Now my TabBar controller is a rootview controller embeded with a navigation controller but when i take action on a presented view controller's UIButton click i am unable to push the login view controller.

TabBarController(Embeded with Navigation controller & also a root view controller) ..> custom pop up view controller with full screen is PRESENTED and when clicked on login button from here .....> i want to push login view controller which can have a back navigation to Tabbar controller.

Can someone please guide me. Thanks in advance.

3

3 Answers

0
votes

You can use delegate to instruct presenting view controller to dimiss the modal and push the needed view controller

0
votes

I believe that you first need to dismiss the current view controller (loginViewController) and in the completion block push the new view controller. So in login view controller, try this:

let presentingController = self.presentingViewController
self.dismiss(animated: true) {
    presentingController?.navigationController?.pushViewController(NewViewController(), animated: true)
}
-1
votes

Have you tried adding animation

CATransition *transition = [[CATransition alloc] init];
transition.duration = 0.5;
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
[transition setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[self.view.window.layer addAnimation:transition forKey:kCATransition];
[self presentViewController:dashboardWorkout animated:false completion:nil];