Reputation:
I want to use Segmented Control to choice between contact form and contact details in the contact ViewController in my app. The contact ViewController is managed by the TabBarController. But when switching by using the Segmented Control the TabBar on the bottom disappears.
I uploaded a sample project here: SegmentedControlTest
Is there a simple way to solve that issue?
Regards, David.
Upvotes: 0
Views: 1428
Reputation: 518
Keeping the current structure you can:
You should change your transition to push and pop instead of both "show" otherwise you'll keep adding on the navigation stack. It's easy to do via code, I can't find how to do this via storyboard. I also recommend changing the structure for your view controllers as suggested by previous answer.
The way I encourage you to do is to use single view controller with multiple container views.
*Connecting .swift code to storyboard. Make sure the class name on custom class section is the same as the class' name. In this case it's "ViewController.swift"
Upvotes: 0
Reputation: 1051
I download your sample project.
As your segue's type is show
,and you want didn't want to disappear tabbar,I guess you only want to exchange the form view
with detail view
.Not show another viewcontroller.
You can solve it by create detail view not detail view controller.
An alternative solution is that you can change UITabBarController
's viewControllers
.
Upvotes: 0