Albert Tesla Ye
Albert Tesla Ye

Reputation: 43

swift - I want to go back to previous viewController which in TabBarController

I want to go back to user viewController which in TabBarController after signed up, but when I go back to the controller in tabBarController there is no tabBar at bottom.

Here is my Code

 let MyPage = self.storyboard?.instantiateViewControllerWithIdentifier("MyViewController")

 presentViewController(MyPage!, animated: true, completion: nil)

MyViewController is the fifth view controller in TabBarController

Please tell me how to go to a view controller in tabBarController,Thank you very much!

Upvotes: 0

Views: 1822

Answers (1)

rnsjtngus
rnsjtngus

Reputation: 225

Instead of using presentViewController function, use dismissViewControllerAnimated function.

replace

self.presentViewController(MyPage, animated: true, completion: nil)

to

self.dismissViewControllerAnimated(true, completion: nil)

Upvotes: 1

Related Questions