I have a TabbarController
with is the entry point of my app.So I want to segue for this TabbarController
to ViewControllerA
. I perform performSegue(with: "identifier")
.I can reach the ViewControllerA
,but when I reach ViewControllerA
there is no NavigationBar
I tried to embed ViewControllerA
into a NavigationController
1st,so the storyboard look like this
TabbarController-> NavigationController -> ViewControllerA
By this,I can reach ViewControllerA.But I have problem in prepareForSegue method.Cause I need to include a value in the segue,now the value seem not included.
My code in prepareForSegue is look like this :
if let VcA = segue.destination.navigationController?.topViewController as? ViewControllerA {
VcA.postId = sender as! Int
}else{
print("cant work")
}
And I also tried to embed the tabbarController to a NavigationController,but in Xcode-> Editor -> Embed
the option is being disable.
So my question is
how to segue from a TabbarController to ViewController and in destination the NavigationBar is visible and can go back to previous screen?